Represents a structured version identifier following Semantic Versioning 2.0 (major.minor.patch). More...
#include <peak_common/types/peak_common_version.hpp>
Public Member Functions | |
| Version (uint32_t major, uint32_t minor, uint32_t subminor, uint32_t patch) | |
| Constructs a Version object with legacy 4-digit layout. | |
| Version (uint32_t major, uint32_t minor, uint32_t patch) | |
| PEAK_COMMON_NO_DISCARD uint32_t | GetMajor () const |
| Retrieves the major version component. | |
| PEAK_COMMON_NO_DISCARD uint32_t | GetMinor () const |
| Retrieves the minor version component. | |
| PEAK_COMMON_DEPRECATED_MSG ("Deprecated due to SemVer 2.0 migration. Always 0; use GetPatch() instead.") PEAK_COMMON_NO_DISCARD uint32_t GetSubminor() const | |
| PEAK_COMMON_NO_DISCARD uint32_t | GetPatch () const |
| Retrieves the patch version component. | |
| PEAK_COMMON_NO_DISCARD bool | operator== (const Version &other) const |
| Checks if two versions are equal. | |
| PEAK_COMMON_NO_DISCARD bool | operator!= (const Version &other) const |
| Checks if two versions are not equal. | |
| PEAK_COMMON_NO_DISCARD bool | operator< (const Version &other) const |
| Checks if this version is less than another version. | |
| PEAK_COMMON_NO_DISCARD bool | operator> (const Version &other) const |
| Checks if this version is greater than another version. | |
| PEAK_COMMON_NO_DISCARD std::string | ToString () const |
| Converts the version to its string representation (e.g., "1.2.3"). | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, Version version) |
| Outputs the version in dot-separated string format (e.g., "1.2.3"). | |
Represents a structured version identifier following Semantic Versioning 2.0 (major.minor.patch).
This class provides utilities for comparing versions and converting them to string format.
|
inline |
Constructs a Version object with legacy 4-digit layout.
|
inline |
|
inline |
Retrieves the major version component.
|
inline |
Retrieves the minor version component.
|
inline |
Retrieves the patch version component.
|
inline |
Checks if two versions are not equal.
| other | The version to compare with. |
|
inline |
Checks if this version is less than another version.
Comparison is performed lexicographically based on version components.
| other | The version to compare with. |
other; false otherwise.
|
inline |
Checks if two versions are equal.
| other | The version to compare with. |
|
inline |
Checks if this version is greater than another version.
| other | The version to compare with. |
other; false otherwise.| peak::common::Version::PEAK_COMMON_DEPRECATED_MSG | ( | "Deprecated due to SemVer 2.0 migration. Always 0; use GetPatch() instead." | ) | const |
|
inline |
Converts the version to its string representation (e.g., "1.2.3").
|
friend |
Outputs the version in dot-separated string format (e.g., "1.2.3").
| os | Output stream. |
| version | The version to write. |