Leosac  0.8.0
Open Source Access Control
Leosac::Tools::Version Class Reference

#include <version.hpp>

+ Collaboration diagram for Leosac::Tools::Version:

Static Public Member Functions

static std::string buildVersionString (int major, int minor, int patch, std::string git_sha1="")
 return semver compatible version string formatted this way: MAJOR.MINOR.PATCH More...
 
static int versionCompare (std::string a, std::string b)
 compare two version strings using semver v2.0.0 More...
 
static bool isVersionValid (const std::string &v)
 check validity of a semver version string More...
 
static std::string get_short_version ()
 Retrieve the short (X.Y.Z) version of Leosac. More...
 
static std::string get_full_version ()
 Returns the complete version string. More...
 

Private Member Functions

 Version ()=delete
 

Static Private Attributes

static const int Major = LEOSAC_VERSION_MAJOR
 
static const int Minor = LEOSAC_VERSION_MINOR
 
static const int Patch = LEOSAC_VERSION_PATCH
 
static const std::string validChars
 

Detailed Description

Definition at line 35 of file version.hpp.

Constructor & Destructor Documentation

◆ Version()

Leosac::Tools::Version::Version ( )
privatedelete

Member Function Documentation

◆ buildVersionString()

std::string Version::buildVersionString ( int  major,
int  minor,
int  patch,
std::string  git_sha1 = "" 
)
static

return semver compatible version string formatted this way: MAJOR.MINOR.PATCH

See also
getVersionString()
Returns
version string

Definition at line 34 of file version.cpp.

◆ get_full_version()

std::string Version::get_full_version ( )
static

Returns the complete version string.

Something like: X.Y.Z-GIT_SHA1

Definition at line 80 of file version.cpp.

◆ get_short_version()

std::string Version::get_short_version ( )
static

Retrieve the short (X.Y.Z) version of Leosac.

Definition at line 85 of file version.cpp.

◆ isVersionValid()

bool Version::isVersionValid ( const std::string &  v)
static

check validity of a semver version string

See also
getVersionString()
Returns
true if the version is valid

Definition at line 74 of file version.cpp.

◆ versionCompare()

int Version::versionCompare ( std::string  a,
std::string  b 
)
static

compare two version strings using semver v2.0.0

See also
getVersionString()
Returns
0 on match, -1 if a older than b, 1 if a is newer than b

Definition at line 51 of file version.cpp.

Member Data Documentation

◆ Major

const int Leosac::Tools::Version::Major = LEOSAC_VERSION_MAJOR
staticprivate

Definition at line 37 of file version.hpp.

◆ Minor

const int Leosac::Tools::Version::Minor = LEOSAC_VERSION_MINOR
staticprivate

Definition at line 38 of file version.hpp.

◆ Patch

const int Leosac::Tools::Version::Patch = LEOSAC_VERSION_PATCH
staticprivate

Definition at line 39 of file version.hpp.

◆ validChars

const std::string Leosac::Tools::Version::validChars
staticprivate

Definition at line 80 of file version.hpp.


The documentation for this class was generated from the following files: