mirror of
https://github.com/taglib/taglib.git
synced 2025-08-15 10:44:39 -04:00
converted tabs to spaces
This commit is contained in:
@ -34,45 +34,45 @@ Mod::File::File(IOStream *stream) : TagLib::File(stream)
|
||||
|
||||
void Mod::File::writeString(const String &s, ulong size)
|
||||
{
|
||||
ByteVector data(s.data(String::Latin1));
|
||||
data.resize(size, 0);
|
||||
writeBlock(data);
|
||||
ByteVector data(s.data(String::Latin1));
|
||||
data.resize(size, 0);
|
||||
writeBlock(data);
|
||||
}
|
||||
|
||||
bool Mod::File::readString(String &s, ulong size)
|
||||
{
|
||||
ByteVector data(readBlock(size));
|
||||
if(data.size() < size) return false;
|
||||
int index = data.find((char) 0);
|
||||
if(index > -1)
|
||||
{
|
||||
data.resize(index);
|
||||
}
|
||||
data.replace((char) 0xff, ' ');
|
||||
ByteVector data(readBlock(size));
|
||||
if(data.size() < size) return false;
|
||||
int index = data.find((char) 0);
|
||||
if(index > -1)
|
||||
{
|
||||
data.resize(index);
|
||||
}
|
||||
data.replace((char) 0xff, ' ');
|
||||
|
||||
s = data;
|
||||
return true;
|
||||
s = data;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mod::File::readByte(uchar &byte)
|
||||
{
|
||||
ByteVector data(readBlock(1));
|
||||
if(data.size() < 1) return false;
|
||||
byte = data[0];
|
||||
return true;
|
||||
ByteVector data(readBlock(1));
|
||||
if(data.size() < 1) return false;
|
||||
byte = data[0];
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mod::File::readU16L(ushort &number)
|
||||
{
|
||||
ByteVector data(readBlock(2));
|
||||
if(data.size() < 2) return false;
|
||||
number = data.toUShort(false);
|
||||
return true;
|
||||
ByteVector data(readBlock(2));
|
||||
if(data.size() < 2) return false;
|
||||
number = data.toUShort(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mod::File::readU32L(ulong &number) {
|
||||
ByteVector data(readBlock(4));
|
||||
if(data.size() < 4) return false;
|
||||
number = data.toUInt(false);
|
||||
return true;
|
||||
ByteVector data(readBlock(4));
|
||||
if(data.size() < 4) return false;
|
||||
number = data.toUInt(false);
|
||||
return true;
|
||||
}
|
||||
|
@ -28,19 +28,19 @@
|
||||
#include "taglib_export.h"
|
||||
|
||||
namespace TagLib {
|
||||
namespace Mod {
|
||||
class TAGLIB_EXPORT File : public TagLib::File {
|
||||
protected:
|
||||
File(FileName file);
|
||||
File(IOStream *stream);
|
||||
namespace Mod {
|
||||
class TAGLIB_EXPORT File : public TagLib::File {
|
||||
protected:
|
||||
File(FileName file);
|
||||
File(IOStream *stream);
|
||||
|
||||
void writeString(const String &s, ulong size);
|
||||
bool readString(String &s, ulong size);
|
||||
bool readByte(uchar &byte);
|
||||
bool readU16L(ushort &number);
|
||||
bool readU32L(ulong &number);
|
||||
};
|
||||
}
|
||||
void writeString(const String &s, ulong size);
|
||||
bool readString(String &s, ulong size);
|
||||
bool readByte(uchar &byte);
|
||||
bool readU16L(ushort &number);
|
||||
bool readU32L(ulong &number);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -24,40 +24,40 @@
|
||||
|
||||
// some helper-macros only used internally by (s3m|it|xm)file.cpp
|
||||
#define READ_ASSERT(cond) \
|
||||
if(!(cond)) \
|
||||
{ \
|
||||
setValid(false); \
|
||||
return; \
|
||||
}
|
||||
if(!(cond)) \
|
||||
{ \
|
||||
setValid(false); \
|
||||
return; \
|
||||
}
|
||||
|
||||
#define READ(setter,type,read) \
|
||||
{ \
|
||||
type number; \
|
||||
READ_ASSERT(read(number)); \
|
||||
setter(number); \
|
||||
}
|
||||
{ \
|
||||
type number; \
|
||||
READ_ASSERT(read(number)); \
|
||||
setter(number); \
|
||||
}
|
||||
|
||||
#define READ_BYTE(setter) READ(setter,uchar,readByte)
|
||||
#define READ_U16L(setter) READ(setter,ushort,readU16L)
|
||||
#define READ_U32L(setter) READ(setter,ulong,readU32L)
|
||||
|
||||
#define READ_STRING(setter,size) \
|
||||
{ \
|
||||
String s; \
|
||||
READ_ASSERT(readString(s, size)); \
|
||||
setter(s); \
|
||||
}
|
||||
{ \
|
||||
String s; \
|
||||
READ_ASSERT(readString(s, size)); \
|
||||
setter(s); \
|
||||
}
|
||||
|
||||
#define READ_AS(type,name,read) \
|
||||
type name = 0; \
|
||||
READ_ASSERT(read(name));
|
||||
type name = 0; \
|
||||
READ_ASSERT(read(name));
|
||||
|
||||
#define READ_BYTE_AS(name) READ_AS(uchar,name,readByte)
|
||||
#define READ_U16L_AS(name) READ_AS(ushort,name,readU16L)
|
||||
#define READ_U32L_AS(name) READ_AS(ulong,name,readU32L)
|
||||
|
||||
#define READ_STRING_AS(name,size) \
|
||||
String name; \
|
||||
READ_ASSERT(readString(name, size));
|
||||
String name; \
|
||||
READ_ASSERT(readString(name, size));
|
||||
|
||||
#endif
|
||||
|
@ -27,60 +27,60 @@ using namespace Mod;
|
||||
class Mod::Tag::TagPrivate
|
||||
{
|
||||
public:
|
||||
TagPrivate() {}
|
||||
TagPrivate() {}
|
||||
|
||||
String title;
|
||||
String comment;
|
||||
String title;
|
||||
String comment;
|
||||
};
|
||||
|
||||
Mod::Tag::Tag() : TagLib::Tag()
|
||||
{
|
||||
d = new TagPrivate;
|
||||
d = new TagPrivate;
|
||||
}
|
||||
|
||||
Mod::Tag::~Tag()
|
||||
{
|
||||
delete d;
|
||||
delete d;
|
||||
}
|
||||
|
||||
String Mod::Tag::title() const
|
||||
{
|
||||
return d->title;
|
||||
return d->title;
|
||||
}
|
||||
|
||||
String Mod::Tag::artist() const
|
||||
{
|
||||
return String::null;
|
||||
return String::null;
|
||||
}
|
||||
|
||||
String Mod::Tag::album() const
|
||||
{
|
||||
return String::null;
|
||||
return String::null;
|
||||
}
|
||||
|
||||
String Mod::Tag::comment() const
|
||||
{
|
||||
return d->comment;
|
||||
return d->comment;
|
||||
}
|
||||
|
||||
String Mod::Tag::genre() const
|
||||
{
|
||||
return String::null;
|
||||
return String::null;
|
||||
}
|
||||
|
||||
uint Mod::Tag::year() const
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint Mod::Tag::track() const
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Mod::Tag::setTitle(const String &title)
|
||||
{
|
||||
d->title = title;
|
||||
d->title = title;
|
||||
}
|
||||
|
||||
void Mod::Tag::setArtist(const String &)
|
||||
@ -93,7 +93,7 @@ void Mod::Tag::setAlbum(const String &)
|
||||
|
||||
void Mod::Tag::setComment(const String &comment)
|
||||
{
|
||||
d->comment = comment;
|
||||
d->comment = comment;
|
||||
}
|
||||
|
||||
void Mod::Tag::setGenre(const String &)
|
||||
|
@ -25,36 +25,36 @@
|
||||
#include "tag.h"
|
||||
|
||||
namespace TagLib {
|
||||
namespace Mod {
|
||||
class TAGLIB_EXPORT Tag : public TagLib::Tag {
|
||||
public:
|
||||
Tag();
|
||||
virtual ~Tag();
|
||||
namespace Mod {
|
||||
class TAGLIB_EXPORT Tag : public TagLib::Tag {
|
||||
public:
|
||||
Tag();
|
||||
virtual ~Tag();
|
||||
|
||||
String title() const;
|
||||
String artist() const;
|
||||
String album() const;
|
||||
String comment() const;
|
||||
String genre() const;
|
||||
uint year() const;
|
||||
uint track() const;
|
||||
String title() const;
|
||||
String artist() const;
|
||||
String album() const;
|
||||
String comment() const;
|
||||
String genre() const;
|
||||
uint year() const;
|
||||
uint track() const;
|
||||
|
||||
void setTitle (const String &title);
|
||||
void setArtist (const String &artist);
|
||||
void setAlbum (const String &album);
|
||||
void setComment(const String &comment);
|
||||
void setGenre (const String &genre);
|
||||
void setYear (uint year);
|
||||
void setTrack(uint track);
|
||||
void setTitle (const String &title);
|
||||
void setArtist (const String &artist);
|
||||
void setAlbum (const String &album);
|
||||
void setComment(const String &comment);
|
||||
void setGenre (const String &genre);
|
||||
void setYear (uint year);
|
||||
void setTrack(uint track);
|
||||
|
||||
private:
|
||||
Tag(const Tag &);
|
||||
Tag &operator=(const Tag &);
|
||||
private:
|
||||
Tag(const Tag &);
|
||||
Tag &operator=(const Tag &);
|
||||
|
||||
class TagPrivate;
|
||||
TagPrivate *d;
|
||||
};
|
||||
}
|
||||
class TagPrivate;
|
||||
TagPrivate *d;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user