libnick 2024.12.0
A cross-platform base for native Nickvision applications.
|
A model for a version number. More...
#include <version.h>
Public Member Functions | |
Version () | |
Constructs a Version. | |
Version (int major, int minor, int build) | |
Constructs a Version. | |
Version (int major, int minor, int build, const std::string &dev) | |
Constructs a Version. | |
Version (const std::string &version) | |
Constructs a Version. | |
int | getMajor () const |
Gets the major number of the version. | |
int | getMinor () const |
Gets the minor number of the version. | |
int | getBuild () const |
Gets the build number of the version. | |
const std::string & | getDev () const |
Gets the dev string of the version. | |
VersionType | getVersionType () const |
Gets the type of the version. | |
const std::string & | str () const |
Gets a string representation of the Version. | |
bool | empty () const |
Gets whether or not the Version object is empty. | |
bool | operator< (const Version &compare) const |
Compares Version objects via < operator. | |
bool | operator<= (const Version &compare) const |
Compares Version objects via <= operator. | |
bool | operator> (const Version &compare) const |
Compares Version objects via > operator. | |
bool | operator>= (const Version &compare) const |
Compares Version objects via >= operator. | |
bool | operator== (const Version &compare) const |
Compares Version objects via == operator. | |
bool | operator!= (const Version &compare) const |
Compares Version objects via != operator. | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Version &version) |
Outputs the Version object. | |
A model for a version number.
Formatted in "major.minor.build-dev".
Nickvision::Update::Version::Version | ( | ) |
Constructs a Version.
Nickvision::Update::Version::Version | ( | int | major, |
int | minor, | ||
int | build ) |
Constructs a Version.
major | The major number |
minor | The minor number |
build | The build number |
Nickvision::Update::Version::Version | ( | int | major, |
int | minor, | ||
int | build, | ||
const std::string & | dev ) |
Constructs a Version.
major | The major number |
minor | The minor number |
build | The build number |
dev | The dev string |
std::invalid_argument | Thrown when the dev version does not contain a "-" |
Nickvision::Update::Version::Version | ( | const std::string & | version | ) |
Constructs a Version.
version | A version string to parse |
std::invalid_argument | Thrown when the version string is not formatted correctly |
bool Nickvision::Update::Version::empty | ( | ) | const |
Gets whether or not the Version object is empty.
int Nickvision::Update::Version::getBuild | ( | ) | const |
Gets the build number of the version.
const std::string & Nickvision::Update::Version::getDev | ( | ) | const |
Gets the dev string of the version.
int Nickvision::Update::Version::getMajor | ( | ) | const |
Gets the major number of the version.
int Nickvision::Update::Version::getMinor | ( | ) | const |
Gets the minor number of the version.
VersionType Nickvision::Update::Version::getVersionType | ( | ) | const |
Gets the type of the version.
bool Nickvision::Update::Version::operator!= | ( | const Version & | compare | ) | const |
bool Nickvision::Update::Version::operator< | ( | const Version & | compare | ) | const |
bool Nickvision::Update::Version::operator<= | ( | const Version & | compare | ) | const |
bool Nickvision::Update::Version::operator== | ( | const Version & | compare | ) | const |
bool Nickvision::Update::Version::operator> | ( | const Version & | compare | ) | const |
bool Nickvision::Update::Version::operator>= | ( | const Version & | compare | ) | const |
const std::string & Nickvision::Update::Version::str | ( | ) | const |
|
friend |
Outputs the Version object.