Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ID3_FrameInfo Class Reference

Provides information about the frame and field types supported by id3lib. More...

#include <id3/field.h>

List of all members.

Public Methods

 ID3_FrameInfo ()
 ~ID3_FrameInfo ()
char* ShortName (ID3_FrameID frameid)
char* LongName (ID3_FrameID frameid)
const char* Description (ID3_FrameID frameid)
int MaxFrameID ()
int NumFields (ID3_FrameID frameid)
ID3_FieldType FieldType (ID3_FrameID frameid, int fieldnum)
size_t FieldSize (ID3_FrameID frameid, int fieldnum)
flags_t FieldFlags (ID3_FrameID frameid, int fieldnum)


Detailed Description

Provides information about the frame and field types supported by id3lib.

You normally only need (at most) one instance of the ID3_FrameInfo. It has no member data -- only methods which provide information about the frame types (and their component fields) supported by id3lib as defined in field.cpp .

Usage is straightforward. The following function uses ID3_FrameInfo to display a summary of all the frames known to id3lib:

 void ShowKnownFrameInfo {
   ID3_FrameInfo myFrameInfo;
   for (int cur = ID3FID_NOFRAME+1; cur < myFrameInfo.MaxFrameID(); cur ++)
   { 
     cout << "Short ID: " << myFrameInfo.ShortName(ID3_FrameID(cur)) <<
        " Long ID: " << myFrameInfo.LongName(ID3_FrameID(cur)) <<
        " Desription: " << myFrameInfo.Description(ID3_FrameID(cur)) << endl;
   }
 } 

Functions are also provided to glean more information about the individual fields which make up any given frame type. The following for() loop, embedded into the previous for() loop would provide a raw look at such information. Realize, of course, that the field type is meaningless when printed. Only when it is taken in the context of the ID3_FieldType enum does it take on any meaningful significance.

  for (int cur = ID3FID_NOFRAME+1; cur < fi.MaxFrameID(); cur ++)
  {
        int numfields = fi.NumFields(ID3_FrameID(cur));

        cout << "ID: " << fi.LongName(ID3_FrameID(cur)) <<
        " FIELDS: " << numfields << endl;
        for(int i=0;i<numfields;i++) {
                cout << "TYPE: " << fi.FieldType(ID3_FrameID(cur),i) <<
                " SIZE: " << fi.FieldSize(ID3_FrameID(cur),i) <<
                " FLAGS: " << fi.FieldFlags(ID3_FrameID(cur),i) << endl;

        }

        cout << endl;

  }

Author:
Cedric Tefft
Version:
Id:
field.cpp,v 1.42 2001/09/08 21:33:18 shadrack Exp

Definition at line 96 of file field.h.


Constructor & Destructor Documentation

ID3_FrameInfo::ID3_FrameInfo ( ) [inline]
 

Definition at line 100 of file field.h.

ID3_FrameInfo::~ID3_FrameInfo ( ) [inline]
 

Definition at line 101 of file field.h.


Member Function Documentation

const char * ID3_FrameInfo::Description ( ID3_FrameID frameid )
 

Parameters:
frameid  

Definition at line 1262 of file field.cpp.

flags_t ID3_FrameInfo::FieldFlags ( ID3_FrameID frameid,
int fieldnum )
 

Parameters:
frameid  
fieldnum  

Definition at line 1292 of file field.cpp.

size_t ID3_FrameInfo::FieldSize ( ID3_FrameID frameid,
int fieldnum )
 

Parameters:
frameid  
fieldnum  

Definition at line 1288 of file field.cpp.

ID3_FieldType ID3_FrameInfo::FieldType ( ID3_FrameID frameid,
int fieldnum )
 

Parameters:
frameid  
fieldnum  

Definition at line 1284 of file field.cpp.

char * ID3_FrameInfo::LongName ( ID3_FrameID frameid )
 

Parameters:
frameid  

Definition at line 1254 of file field.cpp.

int ID3_FrameInfo::MaxFrameID ( )
 

Definition at line 1270 of file field.cpp.

int ID3_FrameInfo::NumFields ( ID3_FrameID frameid )
 

Parameters:
frameid  

Definition at line 1274 of file field.cpp.

char * ID3_FrameInfo::ShortName ( ID3_FrameID frameid )
 

Parameters:
frameid  

Definition at line 1246 of file field.cpp.


The documentation for this class was generated from the following files:
Generated at Sat Sep 8 15:51:12 2001 for id3lib by doxygen1.2.8 written by Dimitri van Heesch, © 1997-2001