mirror of
https://github.com/taglib/taglib.git
synced 2025-06-04 01:28:21 -04:00
Adds a function for dynamic version information retrieval
The current way of exposing TagLib's version only through #define's makes it impossible for clients (e.g. language bindings) to reliably determine the TagLib version that is currently in use: using the define's in client code will statically copy the compile-time values into the client's library, but if TagLib is dynamically bound the version (at least minor and patch version) can change after building client code.
This commit is contained in:
parent
821ff14a43
commit
a16c95b33f
@ -46,6 +46,8 @@
|
||||
* \endcode
|
||||
*/
|
||||
|
||||
#include <tuple>
|
||||
|
||||
namespace TagLib
|
||||
{
|
||||
enum ByteOrder
|
||||
@ -53,6 +55,13 @@ namespace TagLib
|
||||
LittleEndian,
|
||||
BigEndian
|
||||
};
|
||||
/*!
|
||||
* Returns the library's version information as 3-tuple of ints (for major, minor, patch version).
|
||||
*/
|
||||
std::tuple<int, int, int> version()
|
||||
{
|
||||
return std::make_tuple(TAGLIB_MAJOR_VERSION, TAGLIB_MINOR_VERSION, TAGLIB_PATCH_VERSION);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Loading…
x
Reference in New Issue
Block a user