TagLib::FileRef vs. TagLib::File

Theofilos Intzoglou int.teo at gmail.com
Tue May 21 13:01:21 UTC 2013

You should take a look at the api documentation. Most of the classes (if
not all) have a description.
>From http://taglib.github.io/api/classTagLib_1_1FileRef.html :

"FileRef <http://taglib.github.io/api/classTagLib_1_1FileRef.html> exists
to provide a minimal, generic and value-based wrapper around a
It is lightweight and implicitly shared, and as such suitable for
pass-by-value use. This hides some of the uglier details of
 and the non-generic portions of the concrete file implementations.

This class is useful in a "simple usage" situation where it is desirable to
be able to get and set some of the tag information that is similar across
file types."

2013/5/19 Nouvelle Collection <nouvellecollection at gmail.com>

> Hello,
> I don't really understand the difference between TagLib::FileRef and
> TagLib::File.
> If I use TagLib::FileRef f("foo.mp3");, then I cannot use
> f.tag()->removeFrames(...).
> With TagLib::MPEG::File f("foo.mp3"), it seems possible to do
> f.ID3v2Tag()->removeFrames.
> Why is there 2 different things : TagLib::FileRef and TagLib::File
> for the same task (i.e. working with a file) ?
> When is it better to open a file with TagLib::MPEG::File f("foo.mp3")
> and when is it better to use TagLib::FileRef f("foo.mp3")    (like in
> the simple example in http://taglib.github.io/api/) ?
> Thanks in advance.
> _______________________________________________
> taglib-devel mailing list
> taglib-devel at kde.org
> https://mail.kde.org/mailman/listinfo/taglib-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/taglib-devel/attachments/20130521/90cc425e/attachment.html>

More information about the taglib-devel mailing list