Miam-Player  0.8.0
A nice music player
TagLib::APE::Item Class Reference

An implementation of APE-items. More...

#include <apeitem.h>

Public Types

enum  ItemTypes { Text = 0, Binary = 1, Locator = 2 }
 Enum of types an Item can have. More...
 

Public Member Functions

 Item ()
 Constructs an empty item. More...
 
 Item (const String &key, const String &value)
 Constructs a text item with key and value. More...
 
 Item (const String &key, const StringList &values)
 Constructs a text item with key and values. More...
 
 Item (const String &key, const ByteVector &value, bool binary)
 Constructs an item with key and value. More...
 
 Item (const Item &item)
 Construct an item as a copy of item. More...
 
virtual ~Item ()
 Destroys the item. More...
 
Itemoperator= (const Item &item)
 Copies the contents of item into this item. More...
 
void swap (Item &item)
 Exchanges the content of this item by the content of item. More...
 
String key () const
 Returns the key. More...
 
ByteVector binaryData () const
 Returns the binary value. More...
 
void setBinaryData (const ByteVector &value)
 Set the binary value to value The item's type will also be set to Binary. More...
 
ByteVector value () const
 
void setKey (const String &key)
 Sets the key for the item to key. More...
 
void setValue (const String &value)
 Sets the text value of the item to value and clears any previous contents. More...
 
void setValues (const StringList &values)
 Sets the text value of the item to the list of values in value and clears any previous contents. More...
 
void appendValue (const String &value)
 Appends value to create (or extend) the current list of text values. More...
 
void appendValues (const StringList &values)
 Appends values to extend the current list of text values. More...
 
int size () const
 Returns the size of the full item. More...
 
String toString () const
 Returns the value as a single string. More...
 
StringList toStringList () const
 
StringList values () const
 Returns the list of text values. More...
 
ByteVector render () const
 Render the item to a ByteVector. More...
 
void parse (const ByteVector &data)
 Parse the item from the ByteVector data. More...
 
void setReadOnly (bool readOnly)
 Set the item to read-only. More...
 
bool isReadOnly () const
 Return true if the item is read-only. More...
 
void setType (ItemTypes type)
 Sets the type of the item to type. More...
 
ItemTypes type () const
 Returns the type of the item. More...
 
bool isEmpty () const
 Returns if the item has any real content. More...
 

Detailed Description

An implementation of APE-items.

This class provides the features of items in the APEv2 standard.

Member Enumeration Documentation

Enum of types an Item can have.

The value of 3 is reserved.

Enumerator
Text 

Item contains text information coded in UTF-8.

Binary 

Item contains binary information.

Locator 

Item is a locator of external stored information.

Constructor & Destructor Documentation

TagLib::APE::Item::Item ( )

Constructs an empty item.

TagLib::APE::Item::Item ( const String key,
const String value 
)

Constructs a text item with key and value.

TagLib::APE::Item::Item ( const String key,
const StringList values 
)

Constructs a text item with key and values.

TagLib::APE::Item::Item ( const String key,
const ByteVector value,
bool  binary 
)

Constructs an item with key and value.

If binary is true a Binary item will be created, otherwise value will be interpreted as text

TagLib::APE::Item::Item ( const Item item)

Construct an item as a copy of item.

virtual TagLib::APE::Item::~Item ( )
virtual

Destroys the item.

Member Function Documentation

void TagLib::APE::Item::appendValue ( const String value)

Appends value to create (or extend) the current list of text values.

See also
toString()
void TagLib::APE::Item::appendValues ( const StringList values)

Appends values to extend the current list of text values.

See also
toStringList()
ByteVector TagLib::APE::Item::binaryData ( ) const

Returns the binary value.

If the item type is not Binary, always returns an empty ByteVector.

bool TagLib::APE::Item::isEmpty ( ) const

Returns if the item has any real content.

bool TagLib::APE::Item::isReadOnly ( ) const

Return true if the item is read-only.

String TagLib::APE::Item::key ( ) const

Returns the key.

Item& TagLib::APE::Item::operator= ( const Item item)

Copies the contents of item into this item.

void TagLib::APE::Item::parse ( const ByteVector data)

Parse the item from the ByteVector data.

ByteVector TagLib::APE::Item::render ( ) const

Render the item to a ByteVector.

void TagLib::APE::Item::setBinaryData ( const ByteVector value)

Set the binary value to value The item's type will also be set to Binary.

void TagLib::APE::Item::setKey ( const String key)

Sets the key for the item to key.

void TagLib::APE::Item::setReadOnly ( bool  readOnly)

Set the item to read-only.

void TagLib::APE::Item::setType ( ItemTypes  type)

Sets the type of the item to type.

See also
ItemTypes
void TagLib::APE::Item::setValue ( const String value)

Sets the text value of the item to value and clears any previous contents.

See also
toString()
void TagLib::APE::Item::setValues ( const StringList values)

Sets the text value of the item to the list of values in value and clears any previous contents.

See also
toStringList()
int TagLib::APE::Item::size ( ) const

Returns the size of the full item.

void TagLib::APE::Item::swap ( Item item)

Exchanges the content of this item by the content of item.

String TagLib::APE::Item::toString ( ) const

Returns the value as a single string.

In case of multiple strings, the first is returned. If the data type is not Text, always returns an empty String.

StringList TagLib::APE::Item::toStringList ( ) const
ItemTypes TagLib::APE::Item::type ( ) const

Returns the type of the item.

ByteVector TagLib::APE::Item::value ( ) const
StringList TagLib::APE::Item::values ( ) const

Returns the list of text values.

If the data type is not Text, always returns an empty StringList.


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