TagLib::ID3v2::CommentsFrame Class Reference

An implementation of ID3v2 comments. More...

`#include <commentsframe.h>`

Inheritance diagram for TagLib::ID3v2::CommentsFrame:
[legend]
Collaboration diagram for TagLib::ID3v2::CommentsFrame:
[legend]

## Public Member Functions

| CommentsFrame (String::Type encoding=String::Latin1)
| CommentsFrame (const ByteVector &data)
| ~CommentsFrame () override
| CommentsFrame (const CommentsFrame &)=delete
CommentsFrame & | operator= (const CommentsFrame &)=delete
String | toString () const override
ByteVector | language () const
String | description () const
String | text () const
void | setLanguage (const ByteVector &languageEncoding)
void | setDescription (const String &s)
void | setText (const String &s) override
String::Type | textEncoding () const
void | setTextEncoding (String::Type encoding)
PropertyMap | asProperties () const override
Public Member Functions inherited from TagLib::ID3v2::Frame
virtual | ~Frame ()
| Frame (const Frame &)=delete
Frame & | operator= (const Frame &)=delete
ByteVector | frameID () const
unsigned int | size () const
unsigned int | headerSize () const
void | setData (const ByteVector &data)
virtual StringList | toStringList () const
ByteVector | render () const
Header * | header () const

## Static Public Member Functions

static CommentsFrame * | findByDescription (const Tag *tag, const String &d)
Static Public Member Functions inherited from TagLib::ID3v2::Frame
static ByteVector | textDelimiter (String::Type t)
static ByteVector | keyToFrameID (const String &)
static String | frameIDToKey (const ByteVector &)

## Protected Member Functions

void | parseFields (const ByteVector &data) override
ByteVector | renderFields () const override
Protected Member Functions inherited from TagLib::ID3v2::Frame
| Frame (const ByteVector &data)
| Frame (Header *h)
void | setHeader (Header *h, bool deleteCurrent=true)
void | parse (const ByteVector &data)
ByteVector | fieldData (const ByteVector &frameData) const
String | readStringField (const ByteVector &data, String::Type encoding, int *position=nullptr)
String::Type | checkTextEncoding (const StringList &fields, String::Type encoding) const

## Friends

class | FrameFactory

## Additional Inherited Members

Static Public Attributes inherited from TagLib::ID3v2::Frame
static const String | instrumentPrefix
static const String | commentPrefix
static const String | lyricsPrefix
static const String | urlPrefix
Static Protected Member Functions inherited from TagLib::ID3v2::Frame
static void | splitProperties (const PropertyMap &original, PropertyMap &singleFrameProperties, PropertyMap &tiplProperties, PropertyMap &tmclProperties)

## Detailed Description

An implementation of ID3v2 comments.

This implements the ID3v2 comment format. An ID3v2 comment consists of a language encoding, a description and a single text field.

## Constructor & Destructor Documentation

## CommentsFrame() [1/3]

TagLib::ID3v2::CommentsFrame::CommentsFrame | ( | String::Type | encoding = String::Latin1 | ) |

explicit

Construct an empty comment frame that will use the text encoding encoding.

References TagLib::String::Latin1.

Referenced by CommentsFrame(), findByDescription(), operator=(), and renderFields().

## CommentsFrame() [2/3]

TagLib::ID3v2::CommentsFrame::CommentsFrame | ( | const ByteVector & | data | ) |

explicit

Construct a comment based on the data in data.

## ~CommentsFrame()

TagLib::ID3v2::CommentsFrame::~CommentsFrame | ( |  | ) |

override

Destroys this CommentFrame instance.

## CommentsFrame() [3/3]

TagLib::ID3v2::CommentsFrame::CommentsFrame | ( | const CommentsFrame & |  | ) |

delete

References CommentsFrame().

## Member Function Documentation

## asProperties()

PropertyMap TagLib::ID3v2::CommentsFrame::asProperties | ( |  | ) | const

override virtual

Parses this frame as PropertyMap with a single key.

- if description() is empty or "COMMENT", the key will be "COMMENT"
- if description() is not a valid PropertyMap key, the frame will be marked unsupported by an entry "COMM/<description>" in the unsupportedData() attribute of the returned map.
- otherwise, the key will be "COMMENT:<description>"
- The single value will be the frame's text().

Reimplemented from TagLib::ID3v2::Frame.

## description()

String TagLib::ID3v2::CommentsFrame::description | ( |  | ) | const

Returns the description of this comment.

Note
  Most taggers simply ignore this value.

See also
  setDescription()

## findByDescription()

CommentsFrame * TagLib::ID3v2::CommentsFrame::findByDescription | ( | const Tag * | tag,
|  | const String & | d )

static

Comments each have a unique description. This searches for a comment frame with the description d and returns a pointer to it. If no frame is found that matches the given description, null is returned.

See also
  description()

References CommentsFrame(), and TagLib::ID3v2::Frame::Tag.

## language()

ByteVector TagLib::ID3v2::CommentsFrame::language | ( |  | ) | const

Returns the language encoding as a 3 byte encoding as specified by ISO-639-2.

Note
  Most taggers simply ignore this value.

See also
  setLanguage()

## operator=()

CommentsFrame & TagLib::ID3v2::CommentsFrame::operator= | ( | const CommentsFrame & |  | ) |

delete

References CommentsFrame().

## parseFields()

void TagLib::ID3v2::CommentsFrame::parseFields | ( | const ByteVector & | data | ) |

override protected 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.

Implements TagLib::ID3v2::Frame.

## renderFields()

ByteVector TagLib::ID3v2::CommentsFrame::renderFields | ( |  | ) | const

override protected virtual

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

Implements TagLib::ID3v2::Frame.

References CommentsFrame(), and TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE.

## setDescription()

void TagLib::ID3v2::CommentsFrame::setDescription | ( | const String & | s | ) |

Sets the description of the comment to s.

See also
  description()

## setLanguage()

void TagLib::ID3v2::CommentsFrame::setLanguage | ( | const ByteVector & | languageEncoding | ) |

Set the language using the 3 byte language code from ISO-639-2 to languageEncoding.

See also
  language()

## setText()

void TagLib::ID3v2::CommentsFrame::setText | ( | const String & | s | ) |

override virtual

Sets the text portion of the comment to s.

See also
  text()

Reimplemented from TagLib::ID3v2::Frame.

## setTextEncoding()

void TagLib::ID3v2::CommentsFrame::setTextEncoding | ( | String::Type | encoding | ) |

Sets the text encoding to be used when rendering this frame to encoding.

See also
  textEncoding()
  render()

## text()

String TagLib::ID3v2::CommentsFrame::text | ( |  | ) | const

Returns the text of this comment.

See also
  setText()

## textEncoding()

String::Type TagLib::ID3v2::CommentsFrame::textEncoding | ( |  | ) | const

Returns the text encoding that will be used in rendering this frame. This defaults to the type that was either specified in the constructor or read from the frame when parsed.

See also
  setTextEncoding()
  render()

## toString()

String TagLib::ID3v2::CommentsFrame::toString | ( |  | ) | const

override virtual

Returns the text of this comment.

See also
  text()

Implements TagLib::ID3v2::Frame.

## Friends And Related Symbol Documentation

## FrameFactory

friend class FrameFactory

friend

References FrameFactory.

Referenced by FrameFactory.

The documentation for this class was generated from the following file:

- commentsframe.h