libnick 2025.9.1
A cross-platform base for native Nickvision applications.
Loading...
Searching...
No Matches
Nickvision::Update::Version Class Reference

A model for a version number. More...

#include <version.h>

Public Member Functions

 Version () noexcept
 Constructs a Version.
 
 Version (int major, int minor, int build) noexcept
 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 noexcept
 Gets the major number of the version.
 
int getMinor () const noexcept
 Gets the minor number of the version.
 
int getBuild () const noexcept
 Gets the build number of the version.
 
const std::string & getDev () const noexcept
 Gets the dev string of the version.
 
VersionType getVersionType () const noexcept
 Gets the type of the version.
 
const std::string & str () const noexcept
 Gets a string representation of the Version.
 
bool empty () const noexcept
 Gets whether or not the Version object is empty.
 
bool operator< (const Version &compare) const noexcept
 Compares Version objects via < operator.
 
bool operator<= (const Version &compare) const noexcept
 Compares Version objects via <= operator.
 
bool operator> (const Version &compare) const noexcept
 Compares Version objects via > operator.
 
bool operator>= (const Version &compare) const noexcept
 Compares Version objects via >= operator.
 
bool operator== (const Version &compare) const noexcept
 Compares Version objects via == operator.
 
bool operator!= (const Version &compare) const noexcept
 Compares Version objects via != operator.
 

Detailed Description

A model for a version number.

Formatted in "major.minor.build-dev".

Constructor & Destructor Documentation

◆ Version() [1/4]

Nickvision::Update::Version::Version ( )
noexcept

Constructs a Version.

◆ Version() [2/4]

Nickvision::Update::Version::Version ( int major,
int minor,
int build )
noexcept

Constructs a Version.

Parameters
majorThe major number
minorThe minor number
buildThe build number

◆ Version() [3/4]

Nickvision::Update::Version::Version ( int major,
int minor,
int build,
const std::string & dev )

Constructs a Version.

Parameters
majorThe major number
minorThe minor number
buildThe build number
devThe dev string
Exceptions
std::invalid_argumentThrown when the dev version does not contain a "-" or a "." as the first character

◆ Version() [4/4]

Nickvision::Update::Version::Version ( const std::string & version)

Constructs a Version.

Parameters
versionA version string to parse
Exceptions
std::invalid_argumentThrown when the version string is not formatted correctly

Member Function Documentation

◆ empty()

bool Nickvision::Update::Version::empty ( ) const
noexcept

Gets whether or not the Version object is empty.

Returns
True if empty, else false

◆ getBuild()

int Nickvision::Update::Version::getBuild ( ) const
noexcept

Gets the build number of the version.

Returns
The build number

◆ getDev()

const std::string & Nickvision::Update::Version::getDev ( ) const
noexcept

Gets the dev string of the version.

Returns
The dev string

◆ getMajor()

int Nickvision::Update::Version::getMajor ( ) const
noexcept

Gets the major number of the version.

Returns
The major number

◆ getMinor()

int Nickvision::Update::Version::getMinor ( ) const
noexcept

Gets the minor number of the version.

Returns
The minor number

◆ getVersionType()

VersionType Nickvision::Update::Version::getVersionType ( ) const
noexcept

Gets the type of the version.

Returns
VersionType

◆ operator!=()

bool Nickvision::Update::Version::operator!= ( const Version & compare) const
noexcept

Compares Version objects via != operator.

Parameters
compareThe Version object to compare too
Returns
True if this != compare

◆ operator<()

bool Nickvision::Update::Version::operator< ( const Version & compare) const
noexcept

Compares Version objects via < operator.

Parameters
compareThe Version object to compare too
Returns
True if this < compare

◆ operator<=()

bool Nickvision::Update::Version::operator<= ( const Version & compare) const
noexcept

Compares Version objects via <= operator.

Parameters
compareThe Version object to compare too
Returns
True if this <= compare

◆ operator==()

bool Nickvision::Update::Version::operator== ( const Version & compare) const
noexcept

Compares Version objects via == operator.

Parameters
compareThe Version object to compare too
Returns
True if this == compare

◆ operator>()

bool Nickvision::Update::Version::operator> ( const Version & compare) const
noexcept

Compares Version objects via > operator.

Parameters
compareThe Version object to compare too
Returns
True if this > compare

◆ operator>=()

bool Nickvision::Update::Version::operator>= ( const Version & compare) const
noexcept

Compares Version objects via >= operator.

Parameters
compareThe Version object to compare too
Returns
True if this >= compare

◆ str()

const std::string & Nickvision::Update::Version::str ( ) const
noexcept

Gets a string representation of the Version.

Returns
The string representation of the Version

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