jaulib v1.3.8
Jau Support Library (C++, Java, ..)
|
Simple version number class containing a version number either being defined explicit
or derived from a string
.
More...
#include <VersionNumber.hpp>
Public Member Functions | |
constexpr | VersionNumberString () noexcept |
Default ctor for zero version. | |
VersionNumberString (const std::string &versionString) noexcept | |
String derived version number instantiation. | |
VersionNumberString (const std::string &versionString, const std::regex &versionPattern) noexcept | |
String derived version number instantiation. | |
VersionNumberString (const std::string &versionString, const std::string &delim) noexcept | |
String derived version number instantiation. | |
VersionNumberString (const VersionNumberString &) noexcept=default | |
VersionNumberString (VersionNumberString &&) noexcept=default | |
constexpr ssize_t | endOfStringMatch () const noexcept |
If constructed with version-string , returns the string offset after the last matching character, or 0 if none matched, or -1 if not constructed with a string. | |
constexpr bool | hasString () const noexcept |
Returns true if constructed with a version-string , otherwise false. | |
VersionNumberString & | operator= (const VersionNumberString &) noexcept=default |
VersionNumberString & | operator= (VersionNumberString &&) noexcept=default |
std::string | toString () const noexcept |
constexpr const std::string & | versionString () const noexcept |
Returns the used version-string , empty if not constructed with such. | |
![]() | |
constexpr | VersionNumber () noexcept |
Default ctor for zero version. | |
constexpr | VersionNumber (const VersionNumber &) noexcept=default |
constexpr | VersionNumber (int majorRev, int minorRev, int subMinorRev) noexcept |
Explicit version number instantiation, with all components defined explicitly excluding git. | |
constexpr | VersionNumber (int majorRev, int minorRev, int subMinorRev, int gitCommits, uint64_t gitSSHA, bool gitDirty) noexcept |
Explicit version number instantiation, with all components defined explicitly including git. | |
constexpr | VersionNumber (VersionNumber &&) noexcept=default |
constexpr int | git_commits () const noexcept |
constexpr bool | git_dirty () const noexcept |
constexpr uint64_t | git_ssha () const noexcept |
constexpr bool | hasGitInfo () const noexcept |
Returns true , if the optional git information is defined explicitly, otherwise false . | |
constexpr std::size_t | hash () const noexcept |
constexpr bool | hasMajor () const noexcept |
Returns true , if the major component is defined explicitly, otherwise false . | |
constexpr bool | hasMinor () const noexcept |
Returns true , if the optional minor component is defined explicitly, otherwise false . | |
constexpr bool | hasSub () const noexcept |
Returns true , if the optional sub component is defined explicitly, otherwise false . | |
constexpr bool | isZero () const noexcept |
Returns true , if all version components are zero, otherwise false . | |
constexpr int | major () const noexcept |
constexpr int | minor () const noexcept |
constexpr std::strong_ordering | operator<=> (const VersionNumber &vo) const noexcept |
Three way std::strong_ordering comparison operator. | |
constexpr VersionNumber & | operator= (const VersionNumber &) noexcept=default |
constexpr VersionNumber & | operator= (VersionNumber &&) noexcept=default |
constexpr bool | operator== (const VersionNumber &vo) const noexcept |
Two way comparison operator. | |
constexpr int | sub () const noexcept |
std::string | toString () const noexcept |
Static Public Member Functions | |
static const std::regex & | getDefaultPattern () noexcept |
static std::regex | getGitPattern (const std::string &delim) |
static std::regex | getNonGitPattern (const std::string &delim) |
Protected Member Functions | |
constexpr | VersionNumberString (int majorRev, int minorRev, int subMinorRev, int gitCommits, uint64_t gitSSHA, bool gitDirty, uint16_t _state, ssize_t strEnd, std::string _version_str) noexcept |
![]() | |
constexpr | VersionNumber (int majorRev, int minorRev, int subMinorRev, int gitCommits, uint64_t gitSSHA, bool gitDirty, uint16_t _state) noexcept |
Additional Inherited Members | |
![]() | |
int | m_git_commits |
bool | m_git_dirty |
uint64_t | m_git_ssha |
int | m_major |
int | m_minor |
uint16_t | m_state |
int | m_sub |
![]() | |
static constexpr const bool | DBG_OUT = false |
static constexpr const uint16_t | HAS_GIT_INFO = 1U << 3 |
static constexpr const uint16_t | HAS_MAJOR = 1U << 0 |
static constexpr const uint16_t | HAS_MINOR = 1U << 1 |
static constexpr const uint16_t | HAS_SUB = 1U << 2 |
Simple version number class containing a version number either being defined explicit
or derived from a string
.
For the latter case, you can query whether a component has been defined explicitly by the given versionString
, via hasMajor()
, hasMinor()
and hasSub()
.
The state whether a component is defined explicitly is not considered in the hashCode()
, equals(Object)
or compareTo(Object)
methods, since the version number itself is treated regardless.
Definition at line 217 of file VersionNumber.hpp.
|
inlineconstexprprotectednoexcept |
|
inlineconstexprnoexcept |
Default ctor for zero version.
Definition at line 253 of file VersionNumber.hpp.
|
defaultnoexcept |
|
defaultnoexcept |
|
inlinenoexcept |
String derived version number instantiation.
You can query whether a component has been defined explicitly by the given versionString
, via hasMajor()
, hasMinor()
and hasSub()
.
versionString | should be given as [MAJOR[.MINOR[.SUB]]] |
versionPattern | the pattern parser, must be compatible w/ getVersionNumberPattern(String) |
Definition at line 275 of file VersionNumber.hpp.
|
inlinenoexcept |
String derived version number instantiation.
Utilizing the default pattern
parser with delimiter "<b>.</b>", see getDefaultVersionNumberPattern()
.
You can query whether a component has been defined explicitly by the given versionString
, via hasMajor()
, hasMinor()
and hasSub()
.
versionString | should be given as [MAJOR[.MINOR[.SUB]]] |
Definition at line 345 of file VersionNumber.hpp.
|
inlinenoexcept |
String derived version number instantiation.
Utilizing pattern
parser created via getVersionNumberPattern(String)
.
You can query whether a component has been defined explicitly by the given versionString
, via hasMajor()
, hasMinor()
and hasSub()
.
versionString | should be given as [MAJOR[.MINOR[.SUB]]] |
delim | the delimiter, e.g. "." |
Definition at line 365 of file VersionNumber.hpp.
|
inlinestatic |
Definition at line 230 of file VersionNumber.hpp.
|
inlinestatic |
|
inlinestaticnoexcept |
Definition at line 242 of file VersionNumber.hpp.
|
defaultnoexcept |
|
defaultnoexcept |
|
inlineconstexprnoexcept |
Returns true if constructed with a version-string
, otherwise false.
Definition at line 371 of file VersionNumber.hpp.
|
inlineconstexprnoexcept |
Returns the used version-string
, empty if not constructed with such.
Definition at line 373 of file VersionNumber.hpp.
|
inlineconstexprnoexcept |
If constructed with version-string
, returns the string offset after the last matching character, or 0
if none matched, or -1
if not constructed with a string.
Definition at line 379 of file VersionNumber.hpp.
|
inlinenoexcept |
Definition at line 381 of file VersionNumber.hpp.