c++dictionarytaglib

Iterate through taglib property map


Good Evening,

Recently I found the taglib library. It's a really nice one but I can't find a possibility to get the keys and values of unkown keys in a property map (in other words to iterate the map).

This code is used for getting the map:

TagLib::FileRef file(file_path);
TagLib::PropertyMap map = file.tag()->properties();

Any ideas?


Solution

  • You can iterate the same way you iterate over a standard container:

    for (auto it = map.begin(); it != map.end(); it++) {
        // Do something with it.
    }
    

    The documentation shows PropertyMap extends List<T>, which seems to satisfy all container requirements.