Add explicit to constructors with 1 argument

v0.27.3
Luis Díaz Más 7 years ago
parent 2ea9039879
commit dc7eb5008b

@ -270,7 +270,7 @@ namespace Exiv2 {
//! @name Creators //! @name Creators
//@{ //@{
//! Constructor, takes a BasicIo reference //! Constructor, takes a BasicIo reference
IoCloser(BasicIo& bio) : bio_(bio) {} explicit IoCloser(BasicIo& bio) : bio_(bio) {}
//! Destructor, closes the BasicIo reference //! Destructor, closes the BasicIo reference
virtual ~IoCloser() { close(); } virtual ~IoCloser() { close(); }
//@} //@}
@ -307,7 +307,7 @@ namespace Exiv2 {
therefore never failes. therefore never failes.
@param path The full path of a file @param path The full path of a file
*/ */
FileIo(const std::string& path); explicit FileIo(const std::string& path);
#ifdef EXV_UNICODE_PATH #ifdef EXV_UNICODE_PATH
/*! /*!
@brief Like FileIo(const std::string& path) but accepts a @brief Like FileIo(const std::string& path) but accepts a
@ -778,7 +778,7 @@ namespace Exiv2 {
//! @name Creators //! @name Creators
//@{ //@{
//! Default constructor that reads data from stdin/data uri path and writes them to the temp file. //! Default constructor that reads data from stdin/data uri path and writes them to the temp file.
XPathIo(const std::string& orgPath); explicit XPathIo(const std::string& orgPath);
#ifdef EXV_UNICODE_PATH #ifdef EXV_UNICODE_PATH
/*! /*!
@brief Like XPathIo(const std::string& orgPath) but accepts a @brief Like XPathIo(const std::string& orgPath) but accepts a

@ -77,7 +77,7 @@ namespace Exiv2 {
instance after it is passed to this method. Use the Image::io() instance after it is passed to this method. Use the Image::io()
method to get a temporary reference. method to get a temporary reference.
*/ */
BmpImage(BasicIo::AutoPtr io); explicit BmpImage(BasicIo::AutoPtr io);
//@} //@}
//! @name Manipulators //! @name Manipulators

@ -236,7 +236,7 @@ namespace Exiv2 {
//! @name Creators //! @name Creators
//@{ //@{
//! Constructor. //! Constructor.
ExifThumbC(const ExifData& exifData); explicit ExifThumbC(const ExifData& exifData);
//@} //@}
//! @name Accessors //! @name Accessors
@ -305,7 +305,7 @@ namespace Exiv2 {
//! @name Creators //! @name Creators
//@{ //@{
//! Constructor. //! Constructor.
ExifThumb(ExifData& exifData); explicit ExifThumb(ExifData& exifData);
//@} //@}
//! @name Manipulators //! @name Manipulators

@ -78,7 +78,7 @@ namespace Exiv2 {
instance after it is passed to this method. Use the Image::io() instance after it is passed to this method. Use the Image::io()
method to get a temporary reference. method to get a temporary reference.
*/ */
GifImage(BasicIo::AutoPtr io); explicit GifImage(BasicIo::AutoPtr io);
//@} //@}
//! @name Manipulators //! @name Manipulators

@ -140,7 +140,7 @@ public:
/*! @brief Construct INIReader and parse given filename. See ini.h for more info /*! @brief Construct INIReader and parse given filename. See ini.h for more info
about the parsing. about the parsing.
*/ */
INIReader(std::string filename); explicit INIReader(const std::string& filename);
/*! @brief Return the result of ini_parse(), i.e., 0 on success, line number of /*! @brief Return the result of ini_parse(), i.e., 0 on success, line number of
first error on parse error, or -1 on file open error. first error on parse error, or -1 on file open error.

@ -174,7 +174,7 @@ namespace Exiv2 {
//! @name Constructors //! @name Constructors
//@{ //@{
//! Constructor. //! Constructor.
PreviewManager(const Image& image); explicit PreviewManager(const Image& image);
//@} //@}
//! @name Accessors //! @name Accessors

@ -76,14 +76,14 @@ namespace Exiv2 {
//! For comparison with prefix //! For comparison with prefix
struct Prefix { struct Prefix {
//! Constructor. //! Constructor.
Prefix(const std::string& prefix); explicit Prefix(const std::string& prefix);
//! The prefix string. //! The prefix string.
std::string prefix_; std::string prefix_;
}; };
//! For comparison with namespace //! For comparison with namespace
struct Ns { struct Ns {
//! Constructor. //! Constructor.
Ns(const std::string& ns); explicit Ns(const std::string& ns);
//! The namespace string //! The namespace string
std::string ns_; std::string ns_;
}; };

@ -79,7 +79,7 @@ namespace Exiv2 {
instance after it is passed to this method. Use the Image::io() instance after it is passed to this method. Use the Image::io()
method to get a temporary reference. method to get a temporary reference.
*/ */
PsdImage(BasicIo::AutoPtr io); explicit PsdImage(BasicIo::AutoPtr io);
//@} //@}
//! @name Manipulators //! @name Manipulators

@ -69,7 +69,7 @@ namespace Exiv2 {
instance after it is passed to this method. Use the Image::io() instance after it is passed to this method. Use the Image::io()
method to get a temporary reference. method to get a temporary reference.
*/ */
Rw2Image(BasicIo::AutoPtr io); explicit Rw2Image(BasicIo::AutoPtr io);
//@} //@}
//! @name Manipulators //! @name Manipulators

@ -90,7 +90,7 @@ namespace Exiv2 {
{ {
public: public:
//! constructor (acquires the lock) //! constructor (acquires the lock)
RWLock(const pthread_rwlockattr_t *attr = 0) explicit RWLock(const pthread_rwlockattr_t *attr = 0)
{ {
pthread_rwlock_init(&rwlock_, attr); pthread_rwlock_init(&rwlock_, attr);
} }
@ -151,7 +151,7 @@ namespace Exiv2 {
{ {
public: public:
//! constructor - locks the object //! constructor - locks the object
ScopedReadLock(RWLock &rwlock): explicit ScopedReadLock(RWLock &rwlock):
rwlock_(rwlock) rwlock_(rwlock)
{ {
rwlock_.rdlock(); rwlock_.rdlock();
@ -173,7 +173,7 @@ namespace Exiv2 {
{ {
public: public:
//! constructor - locks the object //! constructor - locks the object
ScopedWriteLock(RWLock &rwlock): explicit ScopedWriteLock(RWLock &rwlock):
rwlock_(rwlock) rwlock_(rwlock)
{ {
rwlock_.wrlock(); rwlock_.wrlock();

@ -73,7 +73,7 @@ namespace Exiv2 {
//! Search key to find a GroupInfo by its group name. //! Search key to find a GroupInfo by its group name.
struct GroupInfo::GroupName { struct GroupInfo::GroupName {
GroupName(const std::string& groupName); //!< Constructor explicit GroupName(const std::string& groupName);
std::string g_; //!< Group name std::string g_; //!< Group name
}; };
@ -176,7 +176,8 @@ namespace Exiv2 {
@throw Error if the key cannot be constructed from the tag number @throw Error if the key cannot be constructed from the tag number
and group name. and group name.
*/ */
ExifKey(const TagInfo& ti); explicit ExifKey(const TagInfo& ti);
//! Copy constructor //! Copy constructor
ExifKey(const ExifKey& rhs); ExifKey(const ExifKey& rhs);
//! Destructor //! Destructor

@ -79,7 +79,7 @@ namespace Exiv2 {
instance after it is passed to this method. Use the Image::io() instance after it is passed to this method. Use the Image::io()
method to get a temporary reference. method to get a temporary reference.
*/ */
TgaImage(BasicIo::AutoPtr io); explicit TgaImage(BasicIo::AutoPtr io);
//@} //@}
//! @name Manipulators //! @name Manipulators

@ -195,7 +195,7 @@ namespace Exiv2 {
*/ */
struct EXIV2API DataBufRef { struct EXIV2API DataBufRef {
//! Constructor //! Constructor
DataBufRef(std::pair<byte*, long> rhs) : p(rhs) {} explicit DataBufRef(std::pair<byte*, long> rhs) : p(rhs) {}
//! Pointer to a byte array and its size //! Pointer to a byte array and its size
std::pair<byte*, long> p; std::pair<byte*, long> p;
}; };

@ -282,7 +282,7 @@ time_t Position::deltaMax_ = 60 ;
class UserData class UserData
{ {
public: public:
UserData(Options& options): explicit UserData(Options& options):
indent(0) indent(0)
, count(0) , count(0)
, nTrkpt(0) , nTrkpt(0)

@ -45,7 +45,7 @@ namespace Exiv2 {
//! @name Creators //! @name Creators
//@{ //@{
//! Default constructor //! Default constructor
Cr2Header(ByteOrder byteOrder =littleEndian); explicit Cr2Header(ByteOrder byteOrder =littleEndian);
//! Destructor. //! Destructor.
~Cr2Header(); ~Cr2Header();
//@} //@}

@ -208,7 +208,7 @@ int Exiv2::ini_parse(const char* filename, ini_handler handler, void* user)
return error; return error;
} }
INIReader::INIReader(string filename) INIReader::INIReader(const std::string &filename)
{ {
_error = ini_parse(filename.c_str(), ValueHandler, this); _error = ini_parse(filename.c_str(), ValueHandler, this);
} }

@ -49,7 +49,7 @@ namespace Exiv2 {
//! @name Creators //! @name Creators
//@{ //@{
//! Default constructor //! Default constructor
OrfHeader(ByteOrder byteOrder =littleEndian); explicit OrfHeader(ByteOrder byteOrder =littleEndian);
//! Destructor. //! Destructor.
~OrfHeader(); ~OrfHeader();
//@} //@}

@ -476,7 +476,7 @@ namespace Exiv2 {
class FindExifdatum { class FindExifdatum {
public: public:
//! Constructor, initializes the object with the IfdId to look for. //! Constructor, initializes the object with the IfdId to look for.
FindExifdatum(Exiv2::Internal::IfdId ifdId) : ifdId_(ifdId) {} explicit FindExifdatum(Exiv2::Internal::IfdId ifdId) : ifdId_(ifdId) {}
//! Returns true if IFD id matches. //! Returns true if IFD id matches.
bool operator()(const Exiv2::Exifdatum& md) const { return ifdId_ == md.ifdId(); } bool operator()(const Exiv2::Exifdatum& md) const { return ifdId_ == md.ifdId(); }

Loading…
Cancel
Save