mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
Make the toString() method virtual
This commit is contained in:
parent
e8ae4ecd93
commit
60ba972244
@ -26,17 +26,11 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <fileref.h>
|
||||
#include <mp4file.h>
|
||||
#include <tfile.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace TagLib;
|
||||
|
||||
#define MAYBE_PRINT_DESC(_Type) \
|
||||
if(dynamic_cast<_Type *>(f.file())) { \
|
||||
cout << dynamic_cast<_Type *>(f.file())->toString().to8Bit(true) << endl; \
|
||||
found = 1; \
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// process the command line args
|
||||
@ -46,15 +40,8 @@ int main(int argc, char *argv[])
|
||||
cout << "******************** \"" << argv[i] << "\"********************" << endl;
|
||||
|
||||
FileRef f(argv[i]);
|
||||
|
||||
bool found = 0;
|
||||
if(!f.isNull() && f.file()) {
|
||||
MAYBE_PRINT_DESC(MP4::File);
|
||||
MAYBE_PRINT_DESC(File);
|
||||
}
|
||||
|
||||
if(!found) {
|
||||
cout << "could not find any information about the file" << endl;
|
||||
cout << f.file()->toString().to8Bit(true) << endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -87,7 +87,10 @@ namespace TagLib {
|
||||
*/
|
||||
virtual int channels() const = 0;
|
||||
|
||||
String toString() const;
|
||||
/*!
|
||||
* Returns description of the audio file.
|
||||
*/
|
||||
virtual String toString() const;
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -149,16 +149,3 @@ MP4::File::save()
|
||||
return d->tag->save();
|
||||
}
|
||||
|
||||
String
|
||||
MP4::File::toString() const
|
||||
{
|
||||
StringList desc;
|
||||
if(d->properties) {
|
||||
desc.append(d->properties->toString());
|
||||
}
|
||||
if(d->tag) {
|
||||
desc.append(d->tag->toString());
|
||||
}
|
||||
return desc.toString("\n");
|
||||
}
|
||||
|
||||
|
@ -100,11 +100,6 @@ namespace TagLib {
|
||||
*/
|
||||
bool save();
|
||||
|
||||
/*!
|
||||
* Description of the file.
|
||||
*/
|
||||
String toString() const;
|
||||
|
||||
private:
|
||||
|
||||
void read(bool readProperties, Properties::ReadStyle audioPropertiesStyle);
|
||||
|
@ -179,7 +179,10 @@ namespace TagLib {
|
||||
*/
|
||||
static void duplicate(const Tag *source, Tag *target, bool overwrite = true);
|
||||
|
||||
String toString() const;
|
||||
/*!
|
||||
* Returns description of the tag.
|
||||
*/
|
||||
virtual String toString() const;
|
||||
|
||||
protected:
|
||||
/*!
|
||||
|
@ -246,9 +246,9 @@ namespace TagLib {
|
||||
static bool isWritable(const char *name);
|
||||
|
||||
/*!
|
||||
* Description of the file.
|
||||
* Returns description of the audio file and its tags.
|
||||
*/
|
||||
String toString() const;
|
||||
virtual String toString() const;
|
||||
|
||||
protected:
|
||||
/*!
|
||||
|
Loading…
Reference in New Issue
Block a user