Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

TagLib::ID3v2::Frame Class Reference

ID3v2 frame implementation. More...

#include <id3v2frame.h>

Inheritance diagram for TagLib::ID3v2::Frame:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~Frame ()
ByteVector frameID () const
uint size () const
void setData (const ByteVector &data)
virtual void setText (const String &text)
virtual String toString () const =0
ByteVector render () const

Static Public Member Functions

uint headerSize ()
uint headerSize (uint version)
ByteVector textDelimiter (String::Type t)

Protected Member Functions

 Frame (const ByteVector &data)
 Frame (Header *h)
Headerheader () const
void setHeader (Header *h, bool deleteCurrent=true)
void parse (const ByteVector &data)
virtual void parseFields (const ByteVector &data)=0
virtual ByteVector renderFields () const =0

Friends

class FrameFactory

Detailed Description

ID3v2 frame implementation.

This class is the main ID3v2 frame implementation. In ID3v2, a tag is split between a collection of frames (which are in turn split into fields (Structure, 4) (Frames). This class provides an API for gathering information about and modifying ID3v2 frames. Funtionallity specific to a given frame type is handed in one of the many subclasses.


Constructor & Destructor Documentation

virtual TagLib::ID3v2::Frame::~Frame  )  [virtual]
 

Destroys this Frame instance.

TagLib::ID3v2::Frame::Frame const ByteVector data  )  [explicit, protected]
 

Constructs an ID3v2 frame using data to read the header information. All other processing of data should be handled in a subclass.

Note:
This need not contain anything more than a frame ID, but must constain at least that.

TagLib::ID3v2::Frame::Frame Header h  )  [protected]
 

This creates an Frame using the header h.

The ownership of this header will be assigned to the frame and the header will be deleted when the frame is destroyed.


Member Function Documentation

ByteVector TagLib::ID3v2::Frame::frameID  )  const
 

Returns the Frame ID (Structure, 4) (Frames, 4)

Header* TagLib::ID3v2::Frame::header  )  const [protected]
 

Returns a pointer to the frame header.

uint TagLib::ID3v2::Frame::headerSize uint  version  )  [static]
 

Returns the size of the frame header for the given ID3v2 version.

Deprecated:
Please see the explanation above.

uint TagLib::ID3v2::Frame::headerSize  )  [static]
 

Returns the size of the frame header

Deprecated:
This is only accurate for ID3v2.3 or ID3v2.4. Please use the call below which accepts an ID3v2 version number. In the next non-binary compatible release this will be made into a non-static member that checks the internal ID3v2 version.

void TagLib::ID3v2::Frame::parse const ByteVector data  )  [protected]
 

Called by setData() to parse the frame data. It makes this information available through the public API.

virtual void TagLib::ID3v2::Frame::parseFields const ByteVector data  )  [protected, pure virtual]
 

Called by parse() to parse the field data. It makes this information available through the public API. This must be overridden by the subclasses.

Implemented in TagLib::ID3v2::CommentsFrame, TagLib::ID3v2::TextIdentificationFrame, and TagLib::ID3v2::UnknownFrame.

ByteVector TagLib::ID3v2::Frame::render  )  const
 

Render the frame back to its binary format in a ByteVector.

virtual ByteVector TagLib::ID3v2::Frame::renderFields  )  const [protected, pure virtual]
 

Render the field data back to a binary format in a ByteVector. This must be overridden by subclasses.

Implemented in TagLib::ID3v2::CommentsFrame, TagLib::ID3v2::TextIdentificationFrame, and TagLib::ID3v2::UnknownFrame.

void TagLib::ID3v2::Frame::setData const ByteVector data  ) 
 

Sets the data that will be used as the frame. Since the length is not known before the frame has been parsed, this should just be a pointer to the first byte of the frame. It will determine the length internally and make that available through size().

void TagLib::ID3v2::Frame::setHeader Header h,
bool  deleteCurrent = true
[protected]
 

Sets the header to h. If deleteCurrent is true, this will free the memory of the current header.

The ownership of this header will be assigned to the frame and the header will be deleted when the frame is destroyed.

virtual void TagLib::ID3v2::Frame::setText const String text  )  [virtual]
 

Set the text of frame in the sanest way possible. This should only be reimplemented in frames where there is some logical mapping to text.

Note:
If the frame type supports multiple text encodings, this will not change the text encoding of the frame; the string will be converted to that frame's encoding. Please use the specific APIs of the frame types to set the encoding if that is desired.

Reimplemented in TagLib::ID3v2::CommentsFrame, and TagLib::ID3v2::TextIdentificationFrame.

uint TagLib::ID3v2::Frame::size  )  const
 

Returns the size of the frame.

ByteVector TagLib::ID3v2::Frame::textDelimiter String::Type  t  )  [static]
 

Returns the text delimiter that is used between fields for the string type t.

virtual String TagLib::ID3v2::Frame::toString  )  const [pure virtual]
 

This returns the textual representation of the data in the frame. Subclasses must reimplement this method to provide a string representation of the frame's data.

Implemented in TagLib::ID3v2::CommentsFrame, TagLib::ID3v2::TextIdentificationFrame, and TagLib::ID3v2::UnknownFrame.


Friends And Related Function Documentation

friend class FrameFactory [friend]
 

Reimplemented in TagLib::ID3v2::CommentsFrame, TagLib::ID3v2::TextIdentificationFrame, and TagLib::ID3v2::UnknownFrame.


The documentation for this class was generated from the following file:
Generated on Mon Jun 7 12:51:54 2004 for TagLib by doxygen 1.3.4