These are the pre-v12 classes, kept so existing code keeps building. New code should use the modern API — see Migration Guide: v11 to v12.
optris::Version
Represent a version with major, minor and patch version numbers.
Public functions
Version
OTC_SDK_API Version() noexcept
Constructor.
Version
OTC_SDK_API Version(int major, int minor, int patch) noexcept
Constructor.
Parameters
| Name | Description |
|---|---|
major |
version number. |
minor |
version number. |
patch |
version number. |
getMajor
int getMajor() const noexcept
Returns the major version number.
Returns: major version number.
getMinor
int getMinor() const noexcept
Returns the minor version number.
Returns: minor version number.
getPatch
int getPatch() const noexcept
Returns the patch version number.
Returns: patch version number.
toString
OTC_SDK_API std::string toString() const noexcept
Returns a string representation of the version.
Returns: string representation of the version.
isValid
OTC_SDK_API bool isValid() const noexcept
Returns false when ANY of the three version numbers is zero, not only when all three are -- so 12.0.0, the SDK's own version, is reported invalid.
Returns: true if all three version numbers are non-zero, false otherwise.
operator bool
OTC_SDK_API operator bool() const noexcept
Returns false when ANY of the three version numbers is zero, exactly as isValid() does -- see its warning before using this in a conditional.
Returns: true if all three version numbers are non-zero, false otherwise.
compare
OTC_SDK_API int compare(const Version &rhs) const noexcept
Compares the provided version with the stored one.
Parameters
| Name | Description |
|---|---|
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
OTC_SDK_API int compare(int major, int minor, int patch) const noexcept
Compares the provided version numbers with the stored ones.
Parameters
| Name | Description |
|---|---|
major |
version number to compare with. |
minor |
version number to compare with. |
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.
operator==
bool operator==(const Version &rhs) const noexcept
Return whether the provided version equals the stored one.
Parameters
| Name | Description |
|---|---|
rhs |
version to compare with. |
Returns: true, if the versions are equal. False, otherwise.
operator!=
bool operator!=(const Version &rhs) const noexcept
Return whether the provided version is not equal to the stored one.
Parameters
| Name | Description |
|---|---|
rhs |
version to compare with. |
Returns: true, if the versions are not equal. False, otherwise.
operator<
bool operator<(const Version &rhs) const noexcept
Return whether the stored version is lower than the provided one.
Parameters
| Name | Description |
|---|---|
rhs |
version to compare with. |
Returns: true, if the stored version is lower than the provided one. False otherwise.
operator<=
bool operator<=(const Version &rhs) const noexcept
Return whether the stored version is lower than or equal to the provided one.
Parameters
| Name | Description |
|---|---|
rhs |
version to compare with. |
Returns: true, if the stored version is lower than or equal to the provided one. False otherwise.
operator>
bool operator>(const Version &rhs) const noexcept
Return whether the stored version is higher than to the provided one.
Parameters
| Name | Description |
|---|---|
rhs |
version to compare with. |
Returns: true, if the stored version is higher than the provided one. False otherwise.
operator>=
bool operator>=(const Version &rhs) const noexcept
Return whether the stored version is higher than or equal to the provided one.
Parameters
| Name | Description |
|---|---|
rhs |
version to compare with. |
Returns: true, if the stored version is higher than or equal to the provided one. False otherwise.