mirror of
https://github.com/taglib/taglib.git
synced 2025-07-17 20:44:20 -04:00
Provide properties methods on FileRef, make FileRef non-virtual
Use of FileRef::file() is discouraged, but was necessary to access the properties. It was also not clear whether to access the properties via tag() or file(). With the property methods on FileRef, it should become the "simple usage" interface it was meant to be. As the destructor was the only virtual method on FileRef, it is now made non-virtual. Probably, it is not useful as a virtual base class.
This commit is contained in:
@ -55,7 +55,7 @@ int main(int argc, char *argv[])
|
||||
cout << "track - \"" << tag->track() << "\"" << endl;
|
||||
cout << "genre - \"" << tag->genre() << "\"" << endl;
|
||||
|
||||
TagLib::PropertyMap tags = f.file()->properties();
|
||||
TagLib::PropertyMap tags = f.properties();
|
||||
|
||||
unsigned int longest = 0;
|
||||
for(auto i = tags.cbegin(); i != tags.cend(); ++i) {
|
||||
@ -71,9 +71,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
TagLib::StringList names = f.file()->complexPropertyKeys();
|
||||
TagLib::StringList names = f.complexPropertyKeys();
|
||||
for(const auto &name : names) {
|
||||
const auto& properties = f.file()->complexProperties(name);
|
||||
const auto& properties = f.complexProperties(name);
|
||||
for(const auto &property : properties) {
|
||||
cout << name << ":" << endl;
|
||||
for(const auto &[key, value] : property) {
|
||||
|
Reference in New Issue
Block a user