3.4.0
Version Class Reference

This class implements semver 2.0.0 with one modification: More...

#include <Version.h>

Public Member Functions

bool operator< (const Version &other) const
 
bool operator== (const Version &other) const
 
bool operator> (const Version &other) const
 
std::string vBuild () const
 
 Version (const std::string &str)
 
std::string vLabel () const
 
int vMajor () const
 
int vMinor () const
 
int vPatch () const
 

Private Member Functions

void parse (const std::string &str)
 

Static Private Member Functions

static bool comparePreleaseField (const std::string &pr1, const std::string &pr2)
 
static bool comparePreleases (const std::string &pr1, const std::string &pr2)
 
static bool isNumber (const std::string &str)
 
template<class InputIt1 , class InputIt2 >
static bool lexicographicalCompare (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2)
 
static std::vector< std::string > split (const std::string &s, char delimiter)
 

Private Attributes

std::string m_build
 
std::string m_label
 
int m_major
 
int m_minor
 
int m_patch
 

Detailed Description

This class implements semver 2.0.0 with one modification:

For backwards compatibility we allow to ommit the patch version. A missing patch version is assumed to have the patch version number of 0.

Constructor & Destructor Documentation

◆ Version()

Version::Version ( const std::string &  str)
inlineexplicit

Member Function Documentation

◆ comparePreleaseField()

static bool Version::comparePreleaseField ( const std::string &  pr1,
const std::string &  pr2 
)
inlinestaticprivate

◆ comparePreleases()

static bool Version::comparePreleases ( const std::string &  pr1,
const std::string &  pr2 
)
inlinestaticprivate

◆ isNumber()

static bool Version::isNumber ( const std::string &  str)
inlinestaticprivate

◆ lexicographicalCompare()

template<class InputIt1 , class InputIt2 >
static bool Version::lexicographicalCompare ( InputIt1  first1,
InputIt1  last1,
InputIt2  first2,
InputIt2  last2 
)
inlinestaticprivate

◆ operator<()

bool Version::operator< ( const Version other) const
inline

◆ operator==()

bool Version::operator== ( const Version other) const
inline

◆ operator>()

bool Version::operator> ( const Version other) const
inline

◆ parse()

void Version::parse ( const std::string &  str)
inlineprivate

◆ split()

static std::vector<std::string> Version::split ( const std::string &  s,
char  delimiter 
)
inlinestaticprivate

◆ vBuild()

std::string Version::vBuild ( ) const
inline

◆ vLabel()

std::string Version::vLabel ( ) const
inline

◆ vMajor()

int Version::vMajor ( ) const
inline

◆ vMinor()

int Version::vMinor ( ) const
inline

◆ vPatch()

int Version::vPatch ( ) const
inline

Field Documentation

◆ m_build

std::string Version::m_build
private

◆ m_label

std::string Version::m_label
private

◆ m_major

int Version::m_major
private

◆ m_minor

int Version::m_minor
private

◆ m_patch

int Version::m_patch
private

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