Represent a version with major, minor and patch version numbers.
More...
#include <Version.h>
|
|
OTC_SDK_API | Version () noexcept |
| | Constructor.
|
| |
| OTC_SDK_API | Version (int major, int minor, int patch) noexcept |
| | Constructor.
|
| |
| int | getMajor () const noexcept |
| | Returns the major version number.
|
| |
| int | getMinor () const noexcept |
| | Returns the minor version number.
|
| |
| int | getPatch () const noexcept |
| | Returns the patch version number.
|
| |
| OTC_SDK_API std::string | toString () const noexcept |
| | Returns a string representation of the version.
|
| |
| OTC_SDK_API bool | isValid () const noexcept |
| | Returns whether the stored version is valid.
|
| |
| OTC_SDK_API | operator bool () const noexcept |
| | Returns whether the stored version is valid.
|
| |
| OTC_SDK_API int | compare (const Version &rhs) const noexcept |
| | Compares the provided version with the stored one.
|
| |
| OTC_SDK_API int | compare (int major, int minor, int patch) const noexcept |
| | Compares the provided version numbers with the stored ones.
|
| |
| bool | operator== (const Version &rhs) const noexcept |
| | Return whether the provided version equals the stored one.
|
| |
| bool | operator!= (const Version &rhs) const noexcept |
| | Return whether the provided version is not equal to the stored one.
|
| |
| bool | operator< (const Version &rhs) const noexcept |
| | Return whether the stored version is lower than the provided one.
|
| |
| bool | operator<= (const Version &rhs) const noexcept |
| | Return whether the stored version is lower than or equal to the provided one.
|
| |
| bool | operator> (const Version &rhs) const noexcept |
| | Return whether the stored version is higher than to the provided one.
|
| |
| bool | operator>= (const Version &rhs) const noexcept |
| | Return whether the stored version is higher than or equal to the provided one.
|
| |
Represent a version with major, minor and patch version numbers.
◆ Version()
| OTC_SDK_API optris::Version::Version |
( |
int | major, |
|
|
int | minor, |
|
|
int | patch ) |
|
noexcept |
Constructor.
- Parameters
-
| [in] | major | version number. |
| [in] | minor | version number. |
| [in] | patch | version number. |
◆ compare() [1/2]
Compares the provided version with the stored one.
- Parameters
-
| [in] | rhs | version to compare with. |
- Returns
- 0 if both versions are equal. -1 if the stored version is less than the provided one. +1 if the stored version is greater than the provide one.
◆ compare() [2/2]
| OTC_SDK_API int optris::Version::compare |
( |
int | major, |
|
|
int | minor, |
|
|
int | patch ) const |
|
noexcept |
Compares the provided version numbers with the stored ones.
- Parameters
-
| [in] | major | version number to compare with. |
| [in] | minor | version number to compare with. |
| [in] | patch | version number to compare with. |
- Returns
- 0 if both versions are equal. -1 if the stored version is less than the provided one. +1 if the stored version is greater than the provide one.
◆ getMajor()
| int optris::Version::getMajor |
( |
| ) |
const |
|
inlinenoexcept |
Returns the major version number.
- Returns
- major version number.
◆ getMinor()
| int optris::Version::getMinor |
( |
| ) |
const |
|
inlinenoexcept |
Returns the minor version number.
- Returns
- minor version number.
◆ getPatch()
| int optris::Version::getPatch |
( |
| ) |
const |
|
inlinenoexcept |
Returns the patch version number.
- Returns
- patch version number.
◆ isValid()
Returns whether the stored version is valid.
The version is considered invalid, if all version numbers are zero.
- Returns
- true, if the version is valid. False otherwise.
◆ operator bool()
Returns whether the stored version is valid.
The version is considered invalid, if all version numbers are zero.
- Returns
- true, if ther version is valid. False otherwise.
◆ operator!=()
| bool optris::Version::operator!= |
( |
const Version & | rhs | ) |
const |
|
inlinenoexcept |
Return whether the provided version is not equal to the stored one.
- Parameters
-
| [in] | rhs | version to compare with. |
- Returns
- true, if the versions are not equal. False, otherwise.
◆ operator<()
| bool optris::Version::operator< |
( |
const Version & | rhs | ) |
const |
|
inlinenoexcept |
Return whether the stored version is lower than the provided one.
- Parameters
-
| [in] | rhs | version to compare with. |
- Returns
- true, if the stored version is lower than the provided one. False otherwise.
◆ operator<=()
| bool optris::Version::operator<= |
( |
const Version & | rhs | ) |
const |
|
inlinenoexcept |
Return whether the stored version is lower than or equal to the provided one.
- Parameters
-
| [in] | rhs | version to compare with. |
- Returns
- true, if the stored version is lower than or equal to the provided one. False otherwise.
◆ operator==()
| bool optris::Version::operator== |
( |
const Version & | rhs | ) |
const |
|
inlinenoexcept |
Return whether the provided version equals the stored one.
- Parameters
-
| [in] | rhs | version to compare with. |
- Returns
- true, if the versions are equal. False, otherwise.
◆ operator>()
| bool optris::Version::operator> |
( |
const Version & | rhs | ) |
const |
|
inlinenoexcept |
Return whether the stored version is higher than to the provided one.
- Parameters
-
| [in] | rhs | version to compare with. |
- Returns
- true, if the stored version is higher than the provided one. False otherwise.
◆ operator>=()
| bool optris::Version::operator>= |
( |
const Version & | rhs | ) |
const |
|
inlinenoexcept |
Return whether the stored version is higher than or equal to the provided one.
- Parameters
-
| [in] | rhs | version to compare with. |
- Returns
- true, if the stored version is higher than or equal to the provided one. False otherwise.
◆ toString()
| OTC_SDK_API std::string optris::Version::toString |
( |
| ) |
const |
|
noexcept |
Returns a string representation of the version.
- Returns
- string representation of the version.
The documentation for this class was generated from the following file: