mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
Add explicit keyword wherever easily possible
This commit is contained in:
parent
bd5688ae5f
commit
7eab1bf6df
@ -54,7 +54,7 @@ namespace TagLib {
|
||||
* Constructs an APE footer based on \a data. parse() is called
|
||||
* immediately.
|
||||
*/
|
||||
Footer(const ByteVector &data);
|
||||
explicit Footer(const ByteVector &data);
|
||||
|
||||
/*!
|
||||
* Destroys the footer.
|
||||
|
@ -112,7 +112,7 @@ class ASF::File::FilePrivate::UnknownObject : public ASF::File::FilePrivate::Bas
|
||||
{
|
||||
ByteVector myGuid;
|
||||
public:
|
||||
UnknownObject(const ByteVector &guid);
|
||||
explicit UnknownObject(const ByteVector &guid);
|
||||
ByteVector guid() const;
|
||||
};
|
||||
|
||||
|
@ -61,7 +61,7 @@ namespace TagLib {
|
||||
/*!
|
||||
* Creates an root element using document.
|
||||
*/
|
||||
Element(File *document);
|
||||
explicit Element(File *document);
|
||||
|
||||
/*!
|
||||
* Returns the first found child element with the given id. Returns a null
|
||||
|
@ -30,7 +30,7 @@ using namespace TagLib;
|
||||
class EBML::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate(File *document) : root(document)
|
||||
explicit FilePrivate(File *document) : root(document)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ namespace TagLib {
|
||||
* This constructor is protected since an object should be created
|
||||
* through a specific subclass.
|
||||
*/
|
||||
File(FileName file);
|
||||
explicit File(FileName file);
|
||||
|
||||
/*!
|
||||
* Constructs an instance of an EBML file from an IOStream.
|
||||
@ -69,7 +69,7 @@ namespace TagLib {
|
||||
* This constructor is protected since an object should be created
|
||||
* through a specific subclass.
|
||||
*/
|
||||
File(IOStream *stream);
|
||||
explicit File(IOStream *stream);
|
||||
|
||||
private:
|
||||
//! Non-copyable
|
||||
|
@ -50,7 +50,7 @@ namespace TagLib {
|
||||
/*!
|
||||
* Constructs an instance from a file.
|
||||
*/
|
||||
AudioProperties(File *document);
|
||||
explicit AudioProperties(File *document);
|
||||
|
||||
/*!
|
||||
* Returns the length of the file.
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
FilePrivate(File *p_document) : tag(0), document(p_document)
|
||||
explicit FilePrivate(File *p_document) : tag(0), document(p_document)
|
||||
{
|
||||
// Just get the first segment, because "Typically a Matroska file is
|
||||
// composed of 1 segment."
|
||||
@ -286,7 +286,7 @@ class EBML::Matroska::File::Tag::TagPrivate
|
||||
{
|
||||
public:
|
||||
// Creates a TagPrivate instance
|
||||
TagPrivate(File *p_document) :
|
||||
explicit TagPrivate(File *p_document) :
|
||||
document(p_document),
|
||||
title(document->d->tags.end()),
|
||||
artist(document->d->tags.end()),
|
||||
|
@ -49,12 +49,12 @@ namespace TagLib {
|
||||
/*!
|
||||
* Constructs a Matroska File from a file name.
|
||||
*/
|
||||
File(FileName file);
|
||||
explicit File(FileName file);
|
||||
|
||||
/*!
|
||||
* Constructs a Matroska File from a stream.
|
||||
*/
|
||||
File(IOStream *stream);
|
||||
explicit File(IOStream *stream);
|
||||
|
||||
/*!
|
||||
* Returns the pointer to a tag that allow access on common tags.
|
||||
@ -101,7 +101,7 @@ namespace TagLib {
|
||||
* Creates a new Tag for Matroska files. The given properties are gained
|
||||
* by the Matroska::File.
|
||||
*/
|
||||
Tag(File *document);
|
||||
explicit Tag(File *document);
|
||||
|
||||
/*!
|
||||
* Returns the track name; if no track name is present in the tag
|
||||
|
@ -192,7 +192,7 @@ public:
|
||||
FileRefPrivate() :
|
||||
file() {}
|
||||
|
||||
FileRefPrivate(File *f) :
|
||||
explicit FileRefPrivate(File *f) :
|
||||
file(f) {}
|
||||
|
||||
SHARED_PTR<File> file;
|
||||
|
@ -60,7 +60,7 @@ namespace
|
||||
class FLAC::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate(const ID3v2::FrameFactory *frameFactory) :
|
||||
explicit FilePrivate(const ID3v2::FrameFactory *frameFactory) :
|
||||
ID3v2FrameFactory(ID3v2::FrameFactory::instance()),
|
||||
ID3v2Location(-1),
|
||||
ID3v2OriginalSize(0),
|
||||
|
@ -89,7 +89,7 @@ namespace TagLib {
|
||||
};
|
||||
|
||||
Picture();
|
||||
Picture(const ByteVector &data);
|
||||
explicit Picture(const ByteVector &data);
|
||||
~Picture();
|
||||
|
||||
/*!
|
||||
|
@ -36,7 +36,7 @@ using namespace IT;
|
||||
class IT::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate(AudioProperties::ReadStyle propertiesStyle)
|
||||
explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle)
|
||||
: tag(), properties(propertiesStyle)
|
||||
{
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ namespace TagLib {
|
||||
MidiConfEmbedded = 8
|
||||
};
|
||||
|
||||
AudioProperties(AudioProperties::ReadStyle propertiesStyle);
|
||||
explicit AudioProperties(AudioProperties::ReadStyle propertiesStyle);
|
||||
virtual ~AudioProperties();
|
||||
|
||||
int length() const;
|
||||
|
@ -36,7 +36,7 @@ using namespace Mod;
|
||||
class Mod::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate(AudioProperties::ReadStyle propertiesStyle)
|
||||
explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle)
|
||||
: properties(propertiesStyle)
|
||||
{
|
||||
}
|
||||
|
@ -41,8 +41,8 @@ namespace TagLib {
|
||||
class TAGLIB_EXPORT FileBase : public TagLib::File
|
||||
{
|
||||
protected:
|
||||
FileBase(FileName file);
|
||||
FileBase(IOStream *stream);
|
||||
explicit FileBase(FileName file);
|
||||
explicit FileBase(IOStream *stream);
|
||||
|
||||
void writeString(const String &s, unsigned int size, char padding = 0);
|
||||
void writeByte(unsigned char byte);
|
||||
|
@ -40,7 +40,7 @@ namespace TagLib {
|
||||
friend class File;
|
||||
|
||||
public:
|
||||
AudioProperties(AudioProperties::ReadStyle propertiesStyle);
|
||||
explicit AudioProperties(AudioProperties::ReadStyle propertiesStyle);
|
||||
virtual ~AudioProperties();
|
||||
|
||||
int length() const;
|
||||
|
@ -77,7 +77,7 @@ namespace TagLib {
|
||||
class Atom
|
||||
{
|
||||
public:
|
||||
Atom(File *file);
|
||||
explicit Atom(File *file);
|
||||
~Atom();
|
||||
Atom *find(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0);
|
||||
bool path(AtomList &path, const char *name1, const char *name2 = 0, const char *name3 = 0);
|
||||
@ -95,7 +95,7 @@ namespace TagLib {
|
||||
class Atoms
|
||||
{
|
||||
public:
|
||||
Atoms(File *file);
|
||||
explicit Atoms(File *file);
|
||||
~Atoms();
|
||||
Atom *find(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0);
|
||||
AtomList path(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0);
|
||||
|
@ -109,7 +109,7 @@ namespace TagLib {
|
||||
/*!
|
||||
* Constructs a RelativeVolumeFrame based on the contents of \a data.
|
||||
*/
|
||||
RelativeVolumeFrame(const ByteVector &data);
|
||||
explicit RelativeVolumeFrame(const ByteVector &data);
|
||||
|
||||
/*!
|
||||
* Destroys the RelativeVolumeFrame instance.
|
||||
|
@ -48,7 +48,7 @@ namespace TagLib {
|
||||
/*!
|
||||
* Creates a unique file identifier frame based on \a data.
|
||||
*/
|
||||
UniqueFileIdentifierFrame(const ByteVector &data);
|
||||
explicit UniqueFileIdentifierFrame(const ByteVector &data);
|
||||
|
||||
/*!
|
||||
* Creates a unique file identifier frame with the owner \a owner and
|
||||
|
@ -51,7 +51,7 @@ namespace TagLib {
|
||||
friend class FrameFactory;
|
||||
|
||||
public:
|
||||
UnknownFrame(const ByteVector &data);
|
||||
explicit UnknownFrame(const ByteVector &data);
|
||||
virtual ~UnknownFrame();
|
||||
|
||||
virtual String toString() const;
|
||||
|
@ -175,7 +175,7 @@ namespace TagLib {
|
||||
* The ownership of this header will be assigned to the frame and the
|
||||
* header will be deleted when the frame is destroyed.
|
||||
*/
|
||||
Frame(Header *h);
|
||||
explicit Frame(Header *h);
|
||||
|
||||
/*!
|
||||
* Returns a pointer to the frame header.
|
||||
|
@ -56,7 +56,7 @@ namespace TagLib {
|
||||
* Constructs an ID3v2 header based on \a data. parse() is called
|
||||
* immediately.
|
||||
*/
|
||||
Header(const ByteVector &data);
|
||||
explicit Header(const ByteVector &data);
|
||||
|
||||
/*!
|
||||
* Destroys the header.
|
||||
|
@ -47,7 +47,7 @@ namespace
|
||||
class MPEG::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate(const ID3v2::FrameFactory *frameFactory = ID3v2::FrameFactory::instance()) :
|
||||
explicit FilePrivate(const ID3v2::FrameFactory *frameFactory = ID3v2::FrameFactory::instance()) :
|
||||
ID3v2FrameFactory(frameFactory),
|
||||
ID3v2Location(-1),
|
||||
ID3v2OriginalSize(0),
|
||||
|
@ -52,7 +52,7 @@ namespace TagLib {
|
||||
*
|
||||
* \deprecated
|
||||
*/
|
||||
Header(const ByteVector &data);
|
||||
explicit Header(const ByteVector &data);
|
||||
|
||||
/*!
|
||||
* Parses an MPEG header based on \a file and \a offset.
|
||||
|
@ -77,7 +77,7 @@ namespace TagLib {
|
||||
* Parses an Xing/VBRI header based on \a data which contains the entire
|
||||
* first MPEG frame.
|
||||
*/
|
||||
XingHeader(const ByteVector &data);
|
||||
explicit XingHeader(const ByteVector &data);
|
||||
|
||||
/*!
|
||||
* Destroy this XingHeader instance.
|
||||
|
@ -88,7 +88,7 @@ namespace TagLib {
|
||||
* instantiated directly but rather should be used through the codec
|
||||
* specific subclasses.
|
||||
*/
|
||||
File(FileName file);
|
||||
explicit File(FileName file);
|
||||
|
||||
/*!
|
||||
* Constructs an Ogg file from \a stream.
|
||||
@ -100,7 +100,7 @@ namespace TagLib {
|
||||
* \note TagLib will *not* take ownership of the stream, the caller is
|
||||
* responsible for deleting it after the File object.
|
||||
*/
|
||||
File(IOStream *stream);
|
||||
explicit File(IOStream *stream);
|
||||
|
||||
private:
|
||||
File(const File &);
|
||||
|
@ -65,7 +65,7 @@ namespace
|
||||
class RIFF::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate(ByteOrder endianness) :
|
||||
explicit FilePrivate(ByteOrder endianness) :
|
||||
endianness(endianness),
|
||||
size(0),
|
||||
sizeOffset(0) {}
|
||||
|
@ -66,7 +66,7 @@ namespace TagLib {
|
||||
/*!
|
||||
* Constructs an INFO tag read from \a data which is contents of "LIST" chunk.
|
||||
*/
|
||||
Tag(const ByteVector &data);
|
||||
explicit Tag(const ByteVector &data);
|
||||
|
||||
virtual ~Tag();
|
||||
|
||||
|
@ -38,7 +38,7 @@ using namespace S3M;
|
||||
class S3M::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate(AudioProperties::ReadStyle propertiesStyle)
|
||||
explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle)
|
||||
: properties(propertiesStyle)
|
||||
{
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ namespace TagLib {
|
||||
CustomData = 128
|
||||
};
|
||||
|
||||
AudioProperties(AudioProperties::ReadStyle propertiesStyle);
|
||||
explicit AudioProperties(AudioProperties::ReadStyle propertiesStyle);
|
||||
virtual ~AudioProperties();
|
||||
|
||||
int length() const;
|
||||
|
@ -37,7 +37,7 @@ using namespace TagLib;
|
||||
class ByteVectorStream::ByteVectorStreamPrivate
|
||||
{
|
||||
public:
|
||||
ByteVectorStreamPrivate(const ByteVector &data);
|
||||
explicit ByteVectorStreamPrivate(const ByteVector &data);
|
||||
|
||||
ByteVector data;
|
||||
long long position;
|
||||
|
@ -46,7 +46,7 @@ namespace TagLib {
|
||||
* Construct a File object and opens the \a file. \a file should be a
|
||||
* be a C-string in the local file system encoding.
|
||||
*/
|
||||
ByteVectorStream(const ByteVector &data);
|
||||
explicit ByteVectorStream(const ByteVector &data);
|
||||
|
||||
/*!
|
||||
* Destroys this ByteVectorStream instance.
|
||||
|
@ -247,7 +247,7 @@ namespace TagLib {
|
||||
* \note Constructor is protected since this class should only be
|
||||
* instantiated through subclasses.
|
||||
*/
|
||||
File(const FileName &fileName);
|
||||
explicit File(const FileName &fileName);
|
||||
|
||||
/*!
|
||||
* Construct a File object and use the \a stream instance.
|
||||
@ -258,7 +258,7 @@ namespace TagLib {
|
||||
* \note Constructor is protected since this class should only be
|
||||
* instantiated through subclasses.
|
||||
*/
|
||||
File(IOStream *stream);
|
||||
explicit File(IOStream *stream);
|
||||
|
||||
/*!
|
||||
* Marks the file as valid or invalid.
|
||||
|
@ -90,7 +90,7 @@ namespace
|
||||
|
||||
struct FileNameHandle : public std::string
|
||||
{
|
||||
FileNameHandle(FileName name) : std::string(name) {}
|
||||
explicit FileNameHandle(FileName name) : std::string(name) {}
|
||||
operator FileName () const { return c_str(); }
|
||||
};
|
||||
|
||||
@ -124,7 +124,7 @@ namespace
|
||||
class FileStream::FileStreamPrivate
|
||||
{
|
||||
public:
|
||||
FileStreamPrivate(const FileName &fileName) :
|
||||
explicit FileStreamPrivate(const FileName &fileName) :
|
||||
file(InvalidFileHandle),
|
||||
name(fileName),
|
||||
readOnly(true) {}
|
||||
|
@ -56,10 +56,10 @@ public:
|
||||
FileNamePrivate() :
|
||||
data(new std::wstring()) {}
|
||||
|
||||
FileNamePrivate(const wchar_t *name) :
|
||||
explicit FileNamePrivate(const wchar_t *name) :
|
||||
data(new std::wstring(name)) {}
|
||||
|
||||
FileNamePrivate(const char *name) :
|
||||
explicit FileNamePrivate(const char *name) :
|
||||
data(new std::wstring(ansiToUnicode(name))) {}
|
||||
|
||||
SHARED_PTR<std::wstring> data;
|
||||
|
@ -37,8 +37,8 @@ namespace TagLib {
|
||||
class TAGLIB_EXPORT FileName
|
||||
{
|
||||
public:
|
||||
FileName(const wchar_t *name);
|
||||
FileName(const char *name);
|
||||
explicit FileName(const wchar_t *name);
|
||||
explicit FileName(const char *name);
|
||||
FileName(const FileName &name);
|
||||
|
||||
~FileName();
|
||||
|
@ -97,7 +97,7 @@ namespace TagLib
|
||||
class CounterImpl : public CounterBase
|
||||
{
|
||||
public:
|
||||
CounterImpl(T *p) :
|
||||
explicit CounterImpl(T *p) :
|
||||
p(p) {}
|
||||
|
||||
virtual void dispose()
|
||||
|
@ -52,7 +52,7 @@ namespace
|
||||
class TrueAudio::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate(const ID3v2::FrameFactory *frameFactory = ID3v2::FrameFactory::instance()) :
|
||||
explicit FilePrivate(const ID3v2::FrameFactory *frameFactory = ID3v2::FrameFactory::instance()) :
|
||||
ID3v2FrameFactory(frameFactory),
|
||||
ID3v2Location(-1),
|
||||
ID3v2OriginalSize(0),
|
||||
|
@ -89,7 +89,7 @@ namespace
|
||||
class SkipReader : public Reader
|
||||
{
|
||||
public:
|
||||
SkipReader(unsigned int size) : m_size(size)
|
||||
explicit SkipReader(unsigned int size) : m_size(size)
|
||||
{
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ namespace
|
||||
class ValueReader : public Reader
|
||||
{
|
||||
public:
|
||||
ValueReader(T &value) : value(value)
|
||||
explicit ValueReader(T &value) : value(value)
|
||||
{
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ namespace
|
||||
class ByteReader : public ValueReader<unsigned char>
|
||||
{
|
||||
public:
|
||||
ByteReader(unsigned char &byte) : ValueReader<unsigned char>(byte) {}
|
||||
explicit ByteReader(unsigned char &byte) : ValueReader<unsigned char>(byte) {}
|
||||
|
||||
unsigned int read(TagLib::File &file, unsigned int limit)
|
||||
{
|
||||
@ -360,7 +360,7 @@ namespace
|
||||
class XM::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate(AudioProperties::ReadStyle propertiesStyle)
|
||||
explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle)
|
||||
: tag(), properties(propertiesStyle)
|
||||
{
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ namespace TagLib {
|
||||
LinearFreqTable = 1 // otherwise its the amiga freq. table
|
||||
};
|
||||
|
||||
AudioProperties(AudioProperties::ReadStyle propertiesStyle);
|
||||
explicit AudioProperties(AudioProperties::ReadStyle propertiesStyle);
|
||||
virtual ~AudioProperties();
|
||||
|
||||
int length() const;
|
||||
|
@ -32,7 +32,7 @@ using namespace TagLib;
|
||||
// File subclass that gives tests access to filesystem operations
|
||||
class PlainFile : public File {
|
||||
public:
|
||||
PlainFile(FileName name) : File(name) { }
|
||||
explicit PlainFile(FileName name) : File(name) { }
|
||||
Tag *tag() const { return NULL; }
|
||||
AudioProperties *audioProperties() const { return NULL; }
|
||||
bool save(){ return false; }
|
||||
|
@ -37,7 +37,7 @@ using namespace TagLib;
|
||||
class PublicRIFF : public RIFF::File
|
||||
{
|
||||
public:
|
||||
PublicRIFF(FileName file) : RIFF::File(file, BigEndian) {};
|
||||
explicit PublicRIFF(FileName file) : RIFF::File(file, BigEndian) {};
|
||||
unsigned int riffSize() { return RIFF::File::riffSize(); };
|
||||
size_t chunkCount() { return RIFF::File::chunkCount(); };
|
||||
long long chunkOffset(unsigned int i) { return RIFF::File::chunkOffset(i); };
|
||||
|
@ -92,7 +92,7 @@ private:
|
||||
class DummyBase
|
||||
{
|
||||
public:
|
||||
DummyBase(int x) : value(x)
|
||||
explicit DummyBase(int x) : value(x)
|
||||
{
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ private:
|
||||
class DummyDerived : public DummyBase
|
||||
{
|
||||
public:
|
||||
DummyDerived(int x) : DummyBase(x)
|
||||
explicit DummyDerived(int x) : DummyBase(x)
|
||||
{
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user