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

A map for format-independent <key,valuelist> tag representations. More...

#include <tpropertymap.h>

Inheritance diagram for TagLib::PropertyMap:
TagLib::Map< Key, T >

Public Types

typedef SimplePropertyMap::Iterator Iterator
 
typedef SimplePropertyMap::ConstIterator ConstIterator
 
- Public Types inherited from TagLib::Map< Key, T >
typedef std::map< Key, T >::iterator Iterator
 
typedef std::map< Key, T >::const_iterator ConstIterator
 

Public Member Functions

 PropertyMap ()
 
 PropertyMap (const PropertyMap &m)
 
 PropertyMap (const SimplePropertyMap &m)
 Creates a PropertyMap initialized from a SimplePropertyMap. More...
 
virtual ~PropertyMap ()
 
bool insert (const String &key, const StringList &values)
 Inserts values under key in the map. More...
 
bool replace (const String &key, const StringList &values)
 Replaces any existing values for key with the given values, and simply insert them if key did not exist before. More...
 
Iterator find (const String &key)
 Find the first occurrence of key. More...
 
ConstIterator find (const String &key) const
 Find the first occurrence of key. More...
 
bool contains (const String &key) const
 Returns true if the map contains values for key. More...
 
bool contains (const PropertyMap &other) const
 Returns true if this map contains all keys of other and the values coincide for that keys. More...
 
PropertyMaperase (const String &key)
 Erase the key and its values from the map. More...
 
PropertyMaperase (const PropertyMap &other)
 Erases from this map all keys that appear in other. More...
 
PropertyMapmerge (const PropertyMap &other)
 Merge the contents of other into this PropertyMap. More...
 
const StringListoperator[] (const String &key) const
 Returns a reference to the value associated with key. More...
 
StringListoperator[] (const String &key)
 Returns a reference to the value associated with key. More...
 
bool operator== (const PropertyMap &other) const
 Returns true if and only if has the same contents as this map. More...
 
bool operator!= (const PropertyMap &other) const
 Returns false if and only has the same contents as this map. More...
 
StringListunsupportedData ()
 If a PropertyMap is read from a File object using File::properties(), the StringList returned from this function will represent metadata that could not be parsed into the PropertyMap representation. More...
 
const StringListunsupportedData () const
 
void removeEmpty ()
 Removes all entries which have an empty value list. More...
 
String toString () const
 
- Public Member Functions inherited from TagLib::Map< Key, T >
 Map ()
 Constructs an empty Map. More...
 
 Map (const Map< Key, T > &m)
 Make a shallow, implicitly shared, copy of m. More...
 
virtual ~Map ()
 Destroys this instance of the Map. More...
 
Iterator begin ()
 Returns an STL style iterator to the beginning of the map. More...
 
ConstIterator begin () const
 Returns an STL style iterator to the beginning of the map. More...
 
Iterator end ()
 Returns an STL style iterator to the end of the map. More...
 
ConstIterator end () const
 Returns an STL style iterator to the end of the map. More...
 
Map< Key, T > & insert (const Key &key, const T &value)
 Inserts value under key in the map. More...
 
Map< Key, T > & clear ()
 Removes all of the elements from elements from the map. More...
 
unsigned int size () const
 The number of elements in the map. More...
 
bool isEmpty () const
 Returns true if the map is empty. More...
 
Iterator find (const Key &key)
 Find the first occurrence of key. More...
 
ConstIterator find (const Key &key) const
 Find the first occurrence of key. More...
 
bool contains (const Key &key) const
 Returns true if the map contains an instance of key. More...
 
Map< Key, T > & erase (Iterator it)
 Erase the item at it from the list. More...
 
Map< Key, T > & erase (const Key &key)
 Erase the item with key from the list. More...
 
const T & operator[] (const Key &key) const
 Returns a reference to the value associated with key. More...
 
T & operator[] (const Key &key)
 Returns a reference to the value associated with key. More...
 
Map< Key, T > & operator= (const Map< Key, T > &m)
 Make a shallow, implicitly shared, copy of m. More...
 

Additional Inherited Members

- Protected Member Functions inherited from TagLib::Map< Key, T >
void detach ()
 

Detailed Description

A map for format-independent <key,valuelist> tag representations.

This map implements a generic representation of textual audio metadata ("tags") realized as pairs of a case-insensitive key and a nonempty list of corresponding values, each value being an arbitrary unicode String.

Note that most metadata formats pose additional conditions on the tag keys. The most popular ones (Vorbis, APE, ID3v2) should support all ASCII only words of length between 2 and 16.

This class can contain any tags, but here is a list of "well-known" tags that you might want to use:

Basic tags:

  • TITLE
  • ALBUM
  • ARTIST
  • ALBUMARTIST
  • SUBTITLE
  • TRACKNUMBER
  • DISCNUMBER
  • DATE
  • ORIGINALDATE
  • GENRE
  • COMMENT

Sort names:

  • TITLESORT
  • ALBUMSORT
  • ARTISTSORT
  • ALBUMARTISTSORT

Credits:

  • COMPOSER
  • LYRICIST
  • CONDUCTOR
  • REMIXER
  • PERFORMER:<XXXX>

Other tags:

  • ISRC
  • ASIN
  • BPM
  • COPYRIGHT
  • ENCODEDBY
  • MOOD
  • COMMENT
  • MEDIA
  • LABEL
  • CATALOGNUMBER
  • BARCODE

MusicBrainz identifiers:

  • MUSICBRAINZ_TRACKID
  • MUSICBRAINZ_ALBUMID
  • MUSICBRAINZ_RELEASEGROUPID
  • MUSICBRAINZ_WORKID
  • MUSICBRAINZ_ARTISTID
  • MUSICBRAINZ_ALBUMARTISTID
  • ACOUSTID_ID
  • ACOUSTID_FINGERPRINT
  • MUSICIP_PUID

Member Typedef Documentation

◆ ConstIterator

◆ Iterator

Constructor & Destructor Documentation

◆ PropertyMap() [1/3]

TagLib::PropertyMap::PropertyMap ( )

◆ PropertyMap() [2/3]

TagLib::PropertyMap::PropertyMap ( const PropertyMap m)

◆ PropertyMap() [3/3]

TagLib::PropertyMap::PropertyMap ( const SimplePropertyMap m)

Creates a PropertyMap initialized from a SimplePropertyMap.

Copies all entries from m that have valid keys. Invalid keys will be appended to the unsupportedData() list.

◆ ~PropertyMap()

virtual TagLib::PropertyMap::~PropertyMap ( )
virtual

Member Function Documentation

◆ contains() [1/2]

bool TagLib::PropertyMap::contains ( const String key) const

Returns true if the map contains values for key.

◆ contains() [2/2]

bool TagLib::PropertyMap::contains ( const PropertyMap other) const

Returns true if this map contains all keys of other and the values coincide for that keys.

Does not take the unsupportedData list into account.

◆ erase() [1/2]

PropertyMap& TagLib::PropertyMap::erase ( const String key)

Erase the key and its values from the map.

◆ erase() [2/2]

PropertyMap& TagLib::PropertyMap::erase ( const PropertyMap other)

Erases from this map all keys that appear in other.

◆ find() [1/2]

Iterator TagLib::PropertyMap::find ( const String key)

Find the first occurrence of key.

◆ find() [2/2]

ConstIterator TagLib::PropertyMap::find ( const String key) const

Find the first occurrence of key.

◆ insert()

bool TagLib::PropertyMap::insert ( const String key,
const StringList values 
)

Inserts values under key in the map.

If key already exists, then values will be appended to the existing StringList. The returned value indicates success, i.e. whether key is a valid key.

◆ merge()

PropertyMap& TagLib::PropertyMap::merge ( const PropertyMap other)

Merge the contents of other into this PropertyMap.

If a key is contained in both maps, the values of the second are appended to that of the first. The unsupportedData() lists are concatenated as well.

◆ operator!=()

bool TagLib::PropertyMap::operator!= ( const PropertyMap other) const

Returns false if and only has the same contents as this map.

◆ operator==()

bool TagLib::PropertyMap::operator== ( const PropertyMap other) const

Returns true if and only if has the same contents as this map.

◆ operator[]() [1/2]

const StringList& TagLib::PropertyMap::operator[] ( const String key) const

Returns a reference to the value associated with key.

Note
: If key is not contained in the map, an empty StringList is returned without error.

◆ operator[]() [2/2]

StringList& TagLib::PropertyMap::operator[] ( const String key)

Returns a reference to the value associated with key.

Note
: If key is not contained in the map, an empty StringList is returned. You can also directly add entries by using this function as an lvalue.

◆ removeEmpty()

void TagLib::PropertyMap::removeEmpty ( )

Removes all entries which have an empty value list.

◆ replace()

bool TagLib::PropertyMap::replace ( const String key,
const StringList values 
)

Replaces any existing values for key with the given values, and simply insert them if key did not exist before.

The returned value indicates success, i.e. whether key is a valid key.

◆ toString()

String TagLib::PropertyMap::toString ( ) const

◆ unsupportedData() [1/2]

StringList& TagLib::PropertyMap::unsupportedData ( )

If a PropertyMap is read from a File object using File::properties(), the StringList returned from this function will represent metadata that could not be parsed into the PropertyMap representation.

This could be e.g. binary data, unknown ID3 frames, etc. You can remove items from the returned list, which tells TagLib to remove those unsupported elements if you call File::setProperties() with the same PropertyMap as argument.

◆ unsupportedData() [2/2]

const StringList& TagLib::PropertyMap::unsupportedData ( ) const

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