Added new function Exiv2::versionNumberHexString()

v0.27.3
vog 14 years ago
parent 058f1ea221
commit dd3c11274f

@ -39,12 +39,23 @@ EXIV2_RCSID("@(#) $Id$")
#include "version.hpp" #include "version.hpp"
// + standard includes
#include <iomanip>
#include <sstream>
namespace Exiv2 { namespace Exiv2 {
int versionNumber() int versionNumber()
{ {
return EXIV2_MAKE_VERSION(EXIV2_MAJOR_VERSION, EXIV2_MINOR_VERSION, EXIV2_PATCH_VERSION); return EXIV2_MAKE_VERSION(EXIV2_MAJOR_VERSION, EXIV2_MINOR_VERSION, EXIV2_PATCH_VERSION);
} }
std::string versionNumberHexString()
{
std::ostringstream os;
os << std::hex << std::setw(6) << std::setfill('0') << Exiv2::versionNumber();
return os.str();
}
const char* version() const char* version()
{ {
return EXV_PACKAGE_VERSION; return EXV_PACKAGE_VERSION;

@ -32,6 +32,11 @@
#ifndef VERSION_HPP_ #ifndef VERSION_HPP_
#define VERSION_HPP_ #define VERSION_HPP_
// *****************************************************************************
// included header files
// + standard includes
#include <string>
/*! /*!
@brief %Exiv2 MAJOR version number of the library used at compile-time. @brief %Exiv2 MAJOR version number of the library used at compile-time.
*/ */
@ -116,6 +121,10 @@ namespace Exiv2 {
@brief Return the version of %Exiv2 available at runtime as an integer. @brief Return the version of %Exiv2 available at runtime as an integer.
*/ */
EXIV2API int versionNumber(); EXIV2API int versionNumber();
/*!
@brief Return the version of %Exiv2 as hex string of fixed length 6.
*/
EXIV2API std::string versionNumberHexString();
/*! /*!
@brief Return the version of %Exiv2 available at runtime as a string. @brief Return the version of %Exiv2 available at runtime as a string.
*/ */

Loading…
Cancel
Save