taglib / taglib

TagLib Audio Meta-Data Library
http://taglib.org/
GNU Lesser General Public License v2.1
1.17k stars 345 forks source link

Using TagLib without dynamic_cast and RTTI #731

Open flaviotordini opened 8 years ago

flaviotordini commented 8 years ago

TagLib clients check for a File or Tag implementation by casting, eg:

if (TagLib::MPEG::File *f = dynamic_cast<TagLib::MPEG::File*>(file))

But dynamic_cast is only available when RTTI is enabled. Is there a way of using TagLib without dynamic_cast? If not, consider this a feature request.

sbooth commented 8 years ago

Could you use the properties() method to get the information you need?

flaviotordini commented 8 years ago

One casts to the specific File or Tag implementations in order to deal with the specifics of the file format. So no, I cannot just use the generic property map.

gioerr commented 6 years ago

A library that requires RTTI to work should be marked broken.

StefanBruens commented 6 years ago

An environment that disables RTTI and forces library developers to reinvent the wheel should be marked broken.