diff --git a/taglib/tag.h b/taglib/tag.h index 76c9a82a..93bbfb15 100644 --- a/taglib/tag.h +++ b/taglib/tag.h @@ -64,9 +64,6 @@ namespace TagLib { * Removes unsupported properties, or a subset of them, from the tag. * The parameter \a properties must contain only entries from * properties().unsupportedData(). - * BIC: Will become virtual in future releases. Currently the non-virtual - * standard implementation of TagLib::Tag does nothing, since there are - * no unsupported elements. */ void removeUnsupportedProperties(const StringList& properties); diff --git a/taglib/toolkit/tfile.cpp b/taglib/toolkit/tfile.cpp index 8d7ccdc9..e6062199 100644 --- a/taglib/toolkit/tfile.cpp +++ b/taglib/toolkit/tfile.cpp @@ -119,120 +119,17 @@ FileName File::name() const PropertyMap File::properties() const { - // ugly workaround until this method is virtual - if(dynamic_cast(this)) - return dynamic_cast(this)->properties(); - if(dynamic_cast(this)) - return dynamic_cast(this)->properties(); - if(dynamic_cast(this)) - return dynamic_cast(this)->properties(); - if(dynamic_cast(this)) - return dynamic_cast(this)->properties(); - if(dynamic_cast(this)) - return dynamic_cast(this)->properties(); - if(dynamic_cast(this)) - return dynamic_cast(this)->properties(); - if(dynamic_cast(this)) - return dynamic_cast(this)->properties(); - if(dynamic_cast(this)) - return dynamic_cast(this)->properties(); - if(dynamic_cast(this)) - return dynamic_cast(this)->properties(); - if(dynamic_cast(this)) - return dynamic_cast(this)->properties(); - if(dynamic_cast(this)) - return dynamic_cast(this)->properties(); - if(dynamic_cast(this)) - return dynamic_cast(this)->properties(); - if(dynamic_cast(this)) - return dynamic_cast(this)->properties(); - if(dynamic_cast(this)) - return dynamic_cast(this)->properties(); - if(dynamic_cast(this)) - return dynamic_cast(this)->properties(); - if(dynamic_cast(this)) - return dynamic_cast(this)->properties(); - // no specialized implementation available -> use generic one - // - ASF: ugly format, largely undocumented, not worth implementing - // dict interface ... - // - MP4: taglib's MP4::Tag does not really support anything beyond - // the basic implementation, therefor we use just the default Tag - // interface return tag()->properties(); } void File::removeUnsupportedProperties(const StringList &properties) { - // here we only consider those formats that could possibly contain - // unsupported properties - if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); - else - tag()->removeUnsupportedProperties(properties); + tag()->removeUnsupportedProperties(properties); } PropertyMap File::setProperties(const PropertyMap &properties) { - if(dynamic_cast(this)) - return dynamic_cast(this)->setProperties(properties); - else if(dynamic_cast(this)) - return dynamic_cast(this)->setProperties(properties); - else if(dynamic_cast(this)) - return dynamic_cast(this)->setProperties(properties); - else if(dynamic_cast(this)) - return dynamic_cast(this)->setProperties(properties); - else if(dynamic_cast(this)) - return dynamic_cast(this)->setProperties(properties); - else if(dynamic_cast(this)) - return dynamic_cast(this)->setProperties(properties); - else if(dynamic_cast(this)) - return dynamic_cast(this)->setProperties(properties); - else if(dynamic_cast(this)) - return dynamic_cast(this)->setProperties(properties); - else if(dynamic_cast(this)) - return dynamic_cast(this)->setProperties(properties); - else if(dynamic_cast(this)) - return dynamic_cast(this)->setProperties(properties); - else if(dynamic_cast(this)) - return dynamic_cast(this)->setProperties(properties); - else if(dynamic_cast(this)) - return dynamic_cast(this)->setProperties(properties); - else if(dynamic_cast(this)) - return dynamic_cast(this)->setProperties(properties); - else if(dynamic_cast(this)) - return dynamic_cast(this)->setProperties(properties); - else if(dynamic_cast(this)) - return dynamic_cast(this)->setProperties(properties); - else if(dynamic_cast(this)) - return dynamic_cast(this)->setProperties(properties); - else - return tag()->setProperties(properties); + return tag()->setProperties(properties); } ByteVector File::readBlock(ulong length) diff --git a/taglib/toolkit/tfile.h b/taglib/toolkit/tfile.h index 7e6f2b93..1dfab498 100644 --- a/taglib/toolkit/tfile.h +++ b/taglib/toolkit/tfile.h @@ -86,17 +86,15 @@ namespace TagLib { * format, the returend map's unsupportedData() list will contain one entry identifying * that object (e.g. the frame type for ID3v2 tags). Use removeUnsupportedProperties() * to remove (a subset of) them. - * BIC: Will be made virtual in future releases. */ - PropertyMap properties() const; + virtual PropertyMap properties() const; /*! * Removes unsupported properties, or a subset of them, from the file's metadata. * The parameter \a properties must contain only entries from * properties().unsupportedData(). - * BIC: Will be mad virtual in future releases. */ - void removeUnsupportedProperties(const StringList& properties); + virtual void removeUnsupportedProperties(const StringList& properties); /*! * Sets the tags of this File to those specified in \a properties. Calls the @@ -105,9 +103,9 @@ namespace TagLib { * If some value(s) could not be written imported to the specific metadata format, * the returned PropertyMap will contain those value(s). Otherwise it will be empty, * indicating that no problems occured. - * BIC: will become pure virtual in the future */ - PropertyMap setProperties(const PropertyMap &properties); + virtual PropertyMap setProperties(const PropertyMap &properties); + /*! * Returns a pointer to this file's audio properties. This should be * reimplemented in the concrete subclasses. If no audio properties were