37 PEAK_COMMON_DEPRECATED_MSG(
"Deprecated due to SemVer 2.0 migration. Use Version(major, minor, patch) instead.")
38 Version(uint32_t major, uint32_t minor, uint32_t subminor, uint32_t patch);
43 Version(uint32_t major, uint32_t minor, uint32_t patch);
52 PEAK_COMMON_NO_DISCARD uint32_t
GetMajor()
const;
61 PEAK_COMMON_NO_DISCARD uint32_t
GetMinor()
const;
66 PEAK_COMMON_DEPRECATED_MSG(
67 "Deprecated due to SemVer 2.0 migration. Always 0; use GetPatch() instead.") PEAK_COMMON_NO_DISCARD uint32_t
77 PEAK_COMMON_NO_DISCARD uint32_t
GetPatch()
const;
89 return std::tie(other.m_major, other.m_minor, other.m_patch) == std::tie(this->m_major, this->m_minor, this->m_patch);
102 return !(*
this == other);
117 return std::tie(this->m_major, this->m_minor, this->m_patch) < std::tie(other.m_major, other.m_minor, other.m_patch);
130 return other < *
this;
144 return os << version.m_major <<
'.' << version.m_minor <<
'.' << version.m_patch;
154 PEAK_COMMON_NO_DISCARD std::string
ToString()
const
156 std::ostringstream ss;
162 friend detail::BackendAccessor<Version>;
164 explicit Version(
const detail::c_type_of_t<Version>& version)
165 :
Version(version.major, version.minor, version.patch)
168 explicit operator detail::c_type_of_t<Version>()
const
170 auto cVersion = detail::c_type_of_t<Version>();
177 std::uint32_t m_major{};
178 std::uint32_t m_minor{};
179 std::uint32_t m_subminor{};
180 std::uint32_t m_patch{};
192 , m_subminor{ subminor }
Represents a structured version identifier following Semantic Versioning 2.0 (major....
Definition peak_common_version.hpp:30
Version(uint32_t major, uint32_t minor, uint32_t subminor, uint32_t patch)
Constructs a Version object with legacy 4-digit layout.
Definition peak_common_version.hpp:189
std::string ToString() const
Converts the version to its string representation (e.g., "1.2.3").
Definition peak_common_version.hpp:154
friend std::ostream & operator<<(std::ostream &os, Version version)
Outputs the version in dot-separated string format (e.g., "1.2.3").
Definition peak_common_version.hpp:142
uint32_t GetSubminor() const
Definition peak_common_version.hpp:206
bool operator!=(const Version &other) const
Checks if two versions are not equal.
Definition peak_common_version.hpp:100
uint32_t GetPatch() const
Retrieves the patch version component.
Definition peak_common_version.hpp:211
bool operator>(const Version &other) const
Checks if this version is greater than another version.
Definition peak_common_version.hpp:128
uint32_t GetMajor() const
Retrieves the major version component.
Definition peak_common_version.hpp:196
uint32_t GetMinor() const
Retrieves the minor version component.
Definition peak_common_version.hpp:201
bool operator==(const Version &other) const
Checks if two versions are equal.
Definition peak_common_version.hpp:87
bool operator<(const Version &other) const
Checks if this version is less than another version.
Definition peak_common_version.hpp:115
Root namespace for common types and interfaces shared across multiple libraries.
Definition peak_common_math.hpp:17