Represents a structured version identifier with four components: major, minor, subminor, and patch.
More...
#include <peak_common/types/peak_common_version.hpp>
|
| uint32_t | GetMajor () const |
| | Retrieves the major version component.
|
| uint32_t | GetMinor () const |
| | Retrieves the minor version component.
|
| uint32_t | GetSubminor () const |
| | Retrieves the subminor version component.
|
| uint32_t | GetPatch () const |
| | Retrieves the patch version component.
|
| bool | operator== (const Version &other) const |
| | Checks if two versions are equal.
|
| bool | operator!= (const Version &other) const |
| | Checks if two versions are not equal.
|
| bool | operator< (const Version &other) const |
| | Checks if this version is less than another version.
|
| bool | operator> (const Version &other) const |
| | Checks if this version is greater than another version.
|
| std::string | ToString () const |
| | Converts the version to its string representation (e.g., "1.2.3.4").
|
|
| std::ostream & | operator<< (std::ostream &os, Version version) |
| | Outputs the version in dot-separated string format (e.g., "1.2.3.4").
|
Represents a structured version identifier with four components: major, minor, subminor, and patch.
The version format follows the common scheme: major.minor.subminor.patch, where each component represents a different level of change or compatibility. This class provides utilities for comparing versions and converting them to string format.
- Since
- ids_peak_common 1.0
◆ GetMajor()
| uint32_t GetMajor |
( |
| ) |
const |
|
inline |
Retrieves the major version component.
This is the first part of the version string: major.minor.subminor.patch.
- Returns
- The major version number.
- Since
- ids_peak_common 1.0
◆ GetMinor()
| uint32_t GetMinor |
( |
| ) |
const |
|
inline |
Retrieves the minor version component.
This is the second part of the version string: major.minor.subminor.patch.
- Returns
- The minor version number.
- Since
- ids_peak_common 1.0
◆ GetPatch()
| uint32_t GetPatch |
( |
| ) |
const |
|
inline |
Retrieves the patch version component.
This is the fourth part of the version string: major.minor.subminor.patch.
- Returns
- The patch version number.
- Since
- ids_peak_common 1.0
◆ GetSubminor()
| uint32_t GetSubminor |
( |
| ) |
const |
|
inline |
Retrieves the subminor version component.
This is the third part of the version string: major.minor.subminor.patch.
- Returns
- The subminor version number.
- Since
- ids_peak_common 1.0
◆ operator!=()
| bool operator!= |
( |
const Version & | other | ) |
const |
|
inline |
Checks if two versions are not equal.
- Parameters
-
| other | The version to compare with. |
- Returns
- True if any of the components are not equal; false otherwise.
- Since
- ids_peak_common 1.0
◆ operator<()
| bool operator< |
( |
const Version & | other | ) |
const |
|
inline |
Checks if this version is less than another version.
Comparison is performed lexicographically based on version components.
- Parameters
-
| other | The version to compare with. |
- Returns
- True if this version is less than
other; false otherwise.
- Since
- ids_peak_common 1.0
◆ operator==()
| bool operator== |
( |
const Version & | other | ) |
const |
|
inline |
Checks if two versions are equal.
- Parameters
-
| other | The version to compare with. |
- Returns
- True if all components are equal; false otherwise.
- Since
- ids_peak_common 1.0
◆ operator>()
| bool operator> |
( |
const Version & | other | ) |
const |
|
inline |
Checks if this version is greater than another version.
- Parameters
-
| other | The version to compare with. |
- Returns
- True if this version is greater than
other; false otherwise.
- Since
- ids_peak_common 1.0
◆ ToString()
| std::string ToString |
( |
| ) |
const |
|
inline |
Converts the version to its string representation (e.g., "1.2.3.4").
- Returns
- A string containing the formatted version.
- Since
- ids_peak_common 1.0
◆ operator<<
| std::ostream & operator<< |
( |
std::ostream & | os, |
|
|
Version | version ) |
|
friend |
Outputs the version in dot-separated string format (e.g., "1.2.3.4").
- Parameters
-
| os | Output stream. |
| version | The version to write. |
- Returns
- Reference to the output stream.
- Since
- ids_peak_common 1.0
The documentation for this class was generated from the following file: