libnick 2024.12.0
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 ()
 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.
 

Detailed Description

A model for a version number.

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

Constructor & Destructor Documentation

◆ Version() [1/4]

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

Constructs a Version.

◆ Version() [2/4]

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

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 "-"

◆ 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

Gets whether or not the Version object is empty.

Returns
True if empty, else false

◆ getBuild()

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

Gets the build number of the version.

Returns
The build number

◆ getDev()

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

Gets the dev string of the version.

Returns
The dev string

◆ getMajor()

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

Gets the major number of the version.

Returns
The major number

◆ getMinor()

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

Gets the minor number of the version.

Returns
The minor number

◆ getVersionType()

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

Gets the type of the version.

Returns
VersionType

◆ operator!=()

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

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

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

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

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

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

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

Gets a string representation of the Version.

Returns
The string representation of the Version

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const Version & version )
friend

Outputs the Version object.


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