15 #ifndef SERIALBOX_CORE_VERSION_H 16 #define SERIALBOX_CORE_VERSION_H 29 static int getVersion() {
30 return SERIALBOX_VERSION_MAJOR * 100 + SERIALBOX_VERSION_MINOR * 10 + SERIALBOX_VERSION_PATCH;
39 int major = version / 100;
40 int minor = (version - major * 100) / 10;
44 static std::string
toString(
int major,
int minor,
int patch) {
45 return std::to_string(major) +
"." + std::to_string(minor) +
"." + std::to_string(patch);
53 static bool match(
int version) noexcept {
return version == getVersion(); }
61 static bool isCompatible(
int version) noexcept {
return version <= getVersion(); }
static std::string toString(int version)
Convert to string.
Utility to deal with Serialbox versions.
Namespace of the serialbox library.
static bool match(int version) noexcept
Check if the given version matches the current library version.
static bool isCompatible(int version) noexcept
Check if the given version is compatible with the current library version (i.e. is older) ...