TagLib::PropertyMap Class Reference

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

`#include <tpropertymap.h>`

Inheritance diagram for TagLib::PropertyMap:
[legend]
Collaboration diagram for TagLib::PropertyMap:
[legend]

## Public Types

using | Iterator = SimplePropertyMap::Iterator
using | ConstIterator = SimplePropertyMap::ConstIterator

## Public Member Functions

TAGLIB_EXPORT | PropertyMap ()
TAGLIB_EXPORT | PropertyMap (const PropertyMap &m)
TAGLIB_EXPORT PropertyMap & | operator= (const PropertyMap &other)
TAGLIB_EXPORT | PropertyMap (const SimplePropertyMap &m)
TAGLIB_EXPORT | ~PropertyMap ()
TAGLIB_EXPORT bool | insert (const String &key, const StringList &values)
TAGLIB_EXPORT bool | replace (const String &key, const StringList &values)
TAGLIB_EXPORT Iterator | find (const String &key)
TAGLIB_EXPORT ConstIterator | find (const String &key) const
TAGLIB_EXPORT bool | contains (const String &key) const
TAGLIB_EXPORT bool | contains (const PropertyMap &other) const
TAGLIB_EXPORT PropertyMap & | erase (const String &key)
TAGLIB_EXPORT PropertyMap & | erase (const PropertyMap &other)
TAGLIB_EXPORT PropertyMap & | merge (const PropertyMap &other)
TAGLIB_EXPORT StringList | value (const String &key, const StringList &defaultValue=StringList()) const
TAGLIB_EXPORT const StringList & | operator[] (const String &key) const
TAGLIB_EXPORT StringList & | operator[] (const String &key)
TAGLIB_EXPORT bool | operator== (const PropertyMap &other) const
TAGLIB_EXPORT bool | operator!= (const PropertyMap &other) const
TAGLIB_EXPORT const StringList & | unsupportedData () const
TAGLIB_EXPORT void | addUnsupportedData (const String &key)
TAGLIB_EXPORT void | removeEmpty ()
TAGLIB_EXPORT String | toString () const
Public Member Functions inherited from TagLib::Map< String, StringList >
| Map ()
| Map (const Map< String, StringList > &m)
| Map (std::initializer_list< std::pair< const String, StringList > > init)
| ~Map ()
Iterator | begin ()
ConstIterator | begin () const
ConstIterator | cbegin () const
Iterator | end ()
ConstIterator | end () const
ConstIterator | cend () const
Map< String, StringList > & | insert (const String &key, const StringList &value)
Map< String, StringList > & | clear ()
unsigned int | size () const
bool | isEmpty () const
Iterator | find (const String &key)
ConstIterator | find (const String &key) const
bool | contains (const String &key) const
Map< String, StringList > & | erase (Iterator it)
Map< String, StringList > & | erase (const String &key)
StringList | value (const String &key, const StringList &defaultValue=StringList()) const
const StringList & | operator[] (const String &key) const
StringList & | operator[] (const String &key)
Map< String, StringList > & | operator= (const Map< String, StringList > &m)
Map< String, StringList > & | operator= (std::initializer_list< std::pair< const String, StringList > > init)
void | swap (Map< String, StringList > &m) noexcept
bool | operator== (const Map< String, StringList > &m) const
bool | operator!= (const Map< String, StringList > &m) const

## Additional Inherited Members

Protected Member Functions inherited from TagLib::Map< String, StringList >
void | detach ()

## Detailed Description

A map for format-independent <key,values> 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.

See Mapping of Properties to Various Formats for the mapping of the different formats to properties.

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
- COMPOSERSORT

Credits:

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

Other tags:

- ISRC
- ASIN
- BPM
- COPYRIGHT
- ENCODEDBY
- MOOD
- COMMENT
- MEDIA
- LABEL
- CATALOGNUMBER
- BARCODE
- RELEASECOUNTRY
- RELEASESTATUS
- RELEASETYPE

MusicBrainz identifiers:

- MUSICBRAINZ_TRACKID
- MUSICBRAINZ_ALBUMID
- MUSICBRAINZ_RELEASEGROUPID
- MUSICBRAINZ_RELEASETRACKID
- MUSICBRAINZ_WORKID
- MUSICBRAINZ_ARTISTID
- MUSICBRAINZ_ALBUMARTISTID
- ACOUSTID_ID
- ACOUSTID_FINGERPRINT
- MUSICIP_PUID

## Member Typedef Documentation

## ConstIterator

using TagLib::PropertyMap::ConstIterator = SimplePropertyMap::ConstIterator

## Iterator

using TagLib::PropertyMap::Iterator = SimplePropertyMap::Iterator

## Constructor & Destructor Documentation

## PropertyMap() [1/3]

TAGLIB_EXPORT TagLib::PropertyMap::PropertyMap | ( |  | ) |

References TAGLIB_EXPORT.

Referenced by contains(), erase(), erase(), merge(), operator!=(), operator=(), operator==(), and PropertyMap().

## PropertyMap() [2/3]

TAGLIB_EXPORT TagLib::PropertyMap::PropertyMap | ( | const PropertyMap & | m | ) |

References PropertyMap(), and TAGLIB_EXPORT.

## PropertyMap() [3/3]

TAGLIB_EXPORT 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.

References TAGLIB_EXPORT.

## ~PropertyMap()

TAGLIB_EXPORT TagLib::PropertyMap::~PropertyMap | ( |  | ) |

References TAGLIB_EXPORT.

## Member Function Documentation

## addUnsupportedData()

TAGLIB_EXPORT void TagLib::PropertyMap::addUnsupportedData | ( | const String & | key | ) |

Add property key to list of unsupported data.

See also
  unsupportedData()

References TAGLIB_EXPORT.

## contains() [1/2]

TAGLIB_EXPORT bool TagLib::PropertyMap::contains | ( | const PropertyMap & | other | ) | const

Returns `true` if this map contains all keys of other and the values coincide for those keys. Does not take the unsupportedData list into account.

References PropertyMap(), and TAGLIB_EXPORT.

## contains() [2/2]

TAGLIB_EXPORT bool TagLib::PropertyMap::contains | ( | const String & | key | ) | const

Returns `true` if the map contains values for key.

References TAGLIB_EXPORT.

## erase() [1/2]

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

Erases from this map all keys that appear in other.

References PropertyMap(), and TAGLIB_EXPORT.

## erase() [2/2]

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

Erase the key and its values from the map.

References PropertyMap(), and TAGLIB_EXPORT.

## find() [1/2]

TAGLIB_EXPORT Iterator TagLib::PropertyMap::find | ( | const String & | key | ) |

Find the first occurrence of key.

References TAGLIB_EXPORT.

## find() [2/2]

TAGLIB_EXPORT ConstIterator TagLib::PropertyMap::find | ( | const String & | key | ) | const

Find the first occurrence of key.

References TAGLIB_EXPORT.

## insert()

TAGLIB_EXPORT 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.

References TAGLIB_EXPORT.

## merge()

TAGLIB_EXPORT 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.

References PropertyMap(), and TAGLIB_EXPORT.

## operator!=()

TAGLIB_EXPORT bool TagLib::PropertyMap::operator!= | ( | const PropertyMap & | other | ) | const

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

References PropertyMap(), and TAGLIB_EXPORT.

## operator=()

TAGLIB_EXPORT PropertyMap & TagLib::PropertyMap::operator= | ( | const PropertyMap & | other | ) |

References PropertyMap(), and TAGLIB_EXPORT.

## operator==()

TAGLIB_EXPORT bool TagLib::PropertyMap::operator== | ( | const PropertyMap & | other | ) | const

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

References PropertyMap(), and TAGLIB_EXPORT.

## operator[]() [1/2]

TAGLIB_EXPORT 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.

References TAGLIB_EXPORT.

## operator[]() [2/2]

TAGLIB_EXPORT 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.

References TAGLIB_EXPORT.

## removeEmpty()

TAGLIB_EXPORT void TagLib::PropertyMap::removeEmpty | ( |  | ) |

Removes all entries which have an empty value list.

References TAGLIB_EXPORT.

## replace()

TAGLIB_EXPORT 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.

References TAGLIB_EXPORT.

## toString()

TAGLIB_EXPORT String TagLib::PropertyMap::toString | ( |  | ) | const

## unsupportedData()

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

If a PropertyMap is read from a File object using File::properties() (or a FileRef object using FileRef::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.

See also
  File::removeUnsupportedProperties(), FileRef::removeUnsupportedProperties()

References TAGLIB_EXPORT.

## value()

TAGLIB_EXPORT StringList TagLib::PropertyMap::value | ( | const String & | key,
|  | const StringList & | defaultValue = StringList() ) const

Returns the value associated with key.

If the map does not contain key, it returns defaultValue. If no defaultValue is specified, it returns an empty string list.

References TAGLIB_EXPORT.

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

- tpropertymap.h