Add explicit keyword wherever easily possible

This commit is contained in:
mathbunnyru 2016-12-10 15:20:42 +03:00
parent bd5688ae5f
commit 7eab1bf6df
43 changed files with 58 additions and 58 deletions

View File

@ -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.

View File

@ -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;
};

View File

@ -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

View File

@ -30,7 +30,7 @@ using namespace TagLib;
class EBML::File::FilePrivate
{
public:
FilePrivate(File *document) : root(document)
explicit FilePrivate(File *document) : root(document)
{
}

View File

@ -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

View File

@ -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.

View 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()),

View File

@ -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

View File

@ -192,7 +192,7 @@ public:
FileRefPrivate() :
file() {}
FileRefPrivate(File *f) :
explicit FileRefPrivate(File *f) :
file(f) {}
SHARED_PTR<File> file;

View 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),

View File

@ -89,7 +89,7 @@ namespace TagLib {
};
Picture();
Picture(const ByteVector &data);
explicit Picture(const ByteVector &data);
~Picture();
/*!

View File

@ -36,7 +36,7 @@ using namespace IT;
class IT::File::FilePrivate
{
public:
FilePrivate(AudioProperties::ReadStyle propertiesStyle)
explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle)
: tag(), properties(propertiesStyle)
{
}

View File

@ -58,7 +58,7 @@ namespace TagLib {
MidiConfEmbedded = 8
};
AudioProperties(AudioProperties::ReadStyle propertiesStyle);
explicit AudioProperties(AudioProperties::ReadStyle propertiesStyle);
virtual ~AudioProperties();
int length() const;

View File

@ -36,7 +36,7 @@ using namespace Mod;
class Mod::File::FilePrivate
{
public:
FilePrivate(AudioProperties::ReadStyle propertiesStyle)
explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle)
: properties(propertiesStyle)
{
}

View File

@ -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);

View File

@ -40,7 +40,7 @@ namespace TagLib {
friend class File;
public:
AudioProperties(AudioProperties::ReadStyle propertiesStyle);
explicit AudioProperties(AudioProperties::ReadStyle propertiesStyle);
virtual ~AudioProperties();
int length() const;

View File

@ -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);

View File

@ -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.

View File

@ -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

View File

@ -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;

View File

@ -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.

View File

@ -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.

View File

@ -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),

View File

@ -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.

View File

@ -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.

View File

@ -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 &);

View File

@ -65,7 +65,7 @@ namespace
class RIFF::File::FilePrivate
{
public:
FilePrivate(ByteOrder endianness) :
explicit FilePrivate(ByteOrder endianness) :
endianness(endianness),
size(0),
sizeOffset(0) {}

View File

@ -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();

View File

@ -38,7 +38,7 @@ using namespace S3M;
class S3M::File::FilePrivate
{
public:
FilePrivate(AudioProperties::ReadStyle propertiesStyle)
explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle)
: properties(propertiesStyle)
{
}

View File

@ -51,7 +51,7 @@ namespace TagLib {
CustomData = 128
};
AudioProperties(AudioProperties::ReadStyle propertiesStyle);
explicit AudioProperties(AudioProperties::ReadStyle propertiesStyle);
virtual ~AudioProperties();
int length() const;

View File

@ -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;

View File

@ -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.

View File

@ -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.

View File

@ -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) {}

View File

@ -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;

View File

@ -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();

View File

@ -97,7 +97,7 @@ namespace TagLib
class CounterImpl : public CounterBase
{
public:
CounterImpl(T *p) :
explicit CounterImpl(T *p) :
p(p) {}
virtual void dispose()

View File

@ -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),

View File

@ -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)
{
}

View File

@ -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;

View File

@ -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; }

View File

@ -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); };

View File

@ -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)
{
}