TagLib API Documentation
Public Member Functions | Static Public Member Functions | Friends | List of all members
TagLib::ID3v2::UserTextIdentificationFrame Class Reference

An ID3v2 custom text identification frame implementation. More...

#include <textidentificationframe.h>

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

Public Member Functions

 UserTextIdentificationFrame (String::Type encoding=String::Latin1)
 
 UserTextIdentificationFrame (const ByteVector &data)
 
 UserTextIdentificationFrame (const String &description, const StringList &values, String::Type encoding=String::UTF8)
 
 ~UserTextIdentificationFrame () override
 
 UserTextIdentificationFrame (const UserTextIdentificationFrame &)=delete
 
UserTextIdentificationFrameoperator= (const UserTextIdentificationFrame &)=delete
 
String toString () const override
 
String description () const
 
void setDescription (const String &s)
 
void setText (const String &text) override
 
void setText (const StringList &fields)
 
PropertyMap asProperties () const override
 
- Public Member Functions inherited from TagLib::ID3v2::TextIdentificationFrame
 TextIdentificationFrame (const ByteVector &type, String::Type encoding)
 
 TextIdentificationFrame (const ByteVector &data)
 
 ~TextIdentificationFrame () override
 
 TextIdentificationFrame (const TextIdentificationFrame &)=delete
 
TextIdentificationFrameoperator= (const TextIdentificationFrame &)=delete
 
void setText (const StringList &l)
 
void setText (const String &s) override
 
String toString () const override
 
StringList toStringList () const override
 
String::Type textEncoding () const
 
void setTextEncoding (String::Type encoding)
 
StringList fieldList () const
 
PropertyMap asProperties () const override
 
- Public Member Functions inherited from TagLib::ID3v2::Frame
virtual ~Frame ()
 
 Frame (const Frame &)=delete
 
Frameoperator= (const Frame &)=delete
 
ByteVector frameID () const
 
unsigned int size () const
 
unsigned int headerSize () const
 
void setData (const ByteVector &data)
 
virtual void setText (const String &text)
 
virtual String toString () const =0
 
virtual StringList toStringList () const
 
ByteVector render () const
 
Headerheader () const
 
 Header (const ByteVector &data, unsigned int version=4)
 
virtual ~Header ()
 
 Header (const Header &)=delete
 
Headeroperator= (const Header &)=delete
 
void setData (const ByteVector &data, unsigned int version=4)
 
ByteVector frameID () const
 
void setFrameID (const ByteVector &id)
 
unsigned int frameSize () const
 
void setFrameSize (unsigned int size)
 
unsigned int version () const
 
void setVersion (unsigned int version)
 
unsigned int size () const
 
bool tagAlterPreservation () const
 
void setTagAlterPreservation (bool preserve)
 
bool fileAlterPreservation () const
 
bool readOnly () const
 
bool groupingIdentity () const
 
bool compression () const
 
bool encryption () const
 
bool unsynchronisation () const
 
bool dataLengthIndicator () const
 
ByteVector render () const
 

Static Public Member Functions

static UserTextIdentificationFramefind (const Tag *tag, const String &description)
 
static String keyToTXXX (const String &)
 
static String txxxToKey (const String &)
 
- Static Public Member Functions inherited from TagLib::ID3v2::TextIdentificationFrame
static TextIdentificationFramecreateTIPLFrame (const PropertyMap &properties)
 
static TextIdentificationFramecreateTMCLFrame (const PropertyMap &properties)
 
static const KeyConversionMapinvolvedPeopleMap ()
 
- 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 &)
 

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
 
- Protected Member Functions inherited from TagLib::ID3v2::TextIdentificationFrame
void parseFields (const ByteVector &data) override
 
ByteVector renderFields () const override
 
 TextIdentificationFrame (const ByteVector &data, Header *h)
 
- 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)
 
virtual void parseFields (const ByteVector &data)=0
 
virtual ByteVector renderFields () const =0
 
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
 
virtual PropertyMap asProperties () const
 
- Static Protected Member Functions inherited from TagLib::ID3v2::Frame
static void splitProperties (const PropertyMap &original, PropertyMap &singleFrameProperties, PropertyMap &tiplProperties, PropertyMap &tmclProperties)
 

Detailed Description

An ID3v2 custom text identification frame implementation.

This is a specialization of text identification frames that allows for user defined entries. Each entry has a description in addition to the normal list of fields that a text identification frame has.

This description identifies the frame and must be unique.

Constructor & Destructor Documentation

◆ UserTextIdentificationFrame() [1/4]

TagLib::ID3v2::UserTextIdentificationFrame::UserTextIdentificationFrame ( String::Type  encoding = String::Latin1)
explicit

Constructs an empty user defined text identification frame. For this to be a useful frame both a description and text must be set.

◆ UserTextIdentificationFrame() [2/4]

TagLib::ID3v2::UserTextIdentificationFrame::UserTextIdentificationFrame ( const ByteVector data)
explicit

Creates a frame based on data.

◆ UserTextIdentificationFrame() [3/4]

TagLib::ID3v2::UserTextIdentificationFrame::UserTextIdentificationFrame ( const String description,
const StringList values,
String::Type  encoding = String::UTF8 
)

Creates a user defined text identification frame with the given description and values.

◆ ~UserTextIdentificationFrame()

TagLib::ID3v2::UserTextIdentificationFrame::~UserTextIdentificationFrame ( )
override

◆ UserTextIdentificationFrame() [4/4]

TagLib::ID3v2::UserTextIdentificationFrame::UserTextIdentificationFrame ( const UserTextIdentificationFrame )
delete

Member Function Documentation

◆ asProperties()

PropertyMap TagLib::ID3v2::UserTextIdentificationFrame::asProperties ( ) const
overridevirtual

A UserTextIdentificationFrame is parsed into a PropertyMap as follows:

  • the key is the frame's description, uppercased
  • if the description contains '::', only the substring after that separator is considered as key (compatibility with exfalso)
  • if the above rules don't yield a valid key (e.g. containing non-ASCII characters), the returned map will contain an entry "TXXX/<description>" in its unsupportedData() list.
  • The values will be copies of the fieldList().
  • If the description() appears as value in fieldList(), it will be omitted in the value list, in order to be compatible with TagLib which copies the description() into the fieldList().

Reimplemented from TagLib::ID3v2::TextIdentificationFrame.

◆ description()

String TagLib::ID3v2::UserTextIdentificationFrame::description ( ) const

Returns the description for this frame.

◆ find()

static UserTextIdentificationFrame * TagLib::ID3v2::UserTextIdentificationFrame::find ( const Tag tag,
const String description 
)
static

Searches for the user defined text frame with the description description in tag. This returns null if no matching frames were found.

◆ keyToTXXX()

static String TagLib::ID3v2::UserTextIdentificationFrame::keyToTXXX ( const String )
static

Returns an appropriate TXXX frame description for the given free-form tag key.

◆ operator=()

UserTextIdentificationFrame & TagLib::ID3v2::UserTextIdentificationFrame::operator= ( const UserTextIdentificationFrame )
delete

◆ setDescription()

void TagLib::ID3v2::UserTextIdentificationFrame::setDescription ( const String s)

Sets the description of the frame to s. s must be unique. You can check for the presence of another user defined text frame of the same type using find() and testing for null.

◆ setText() [1/2]

void TagLib::ID3v2::UserTextIdentificationFrame::setText ( const String text)
overridevirtual

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 from TagLib::ID3v2::TextIdentificationFrame.

◆ setText() [2/2]

void TagLib::ID3v2::UserTextIdentificationFrame::setText ( const StringList fields)

◆ toString()

String TagLib::ID3v2::UserTextIdentificationFrame::toString ( ) const
overridevirtual

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.

Reimplemented from TagLib::ID3v2::TextIdentificationFrame.

◆ txxxToKey()

static String TagLib::ID3v2::UserTextIdentificationFrame::txxxToKey ( const String )
static

Returns a free-form tag name for the given ID3 frame description.

Friends And Related Function Documentation

◆ FrameFactory

friend class FrameFactory
friend

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