AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
aui::updater::Semver Struct Reference

Semantic version. More...

#include <AUI/Updater/Semver.h>

Public Member Functions#

uint64_t toLongInt () const noexcept
 Converts semver to a long int representation.
 
bool operator== (const Semver &) const =default
 
bool operator< (const Semver &rhs) const
 
bool operator> (const Semver &rhs) const
 
bool operator<= (const Semver &rhs) const
 
bool operator>= (const Semver &rhs) const
 

Static Public Member Functions#

static Semver fromString (const AString &version)
 Parse semver from string.
 

Signals and public fields#

unsigned major {}
 
unsigned minor {}
 
unsigned patch {}
 

Detailed Description#

Parsing version#

Up to 3 numbers split with dots are supported:

EXPECT_EQ(aui::updater::Semver::fromString("1.2.3"), (aui::updater::Semver{ 1, 2, 3 }));
Semantic version.
Definition Semver.h:9
static Semver fromString(const AString &version)
Parse semver from string.

v prefix is acceptable:

EXPECT_EQ(aui::updater::Semver::fromString("v1.2.3"), (aui::updater::Semver{ 1, 2, 3 }));
EXPECT_EQ(aui::updater::Semver::fromString("v0.0.0"), (aui::updater::Semver{ 0, 0, 0 }));

"Channel names" and other suffixes are ignored:

EXPECT_EQ(aui::updater::Semver::fromString("1.2.3-beta"), (aui::updater::Semver{ 1, 2, 3 }));