40 Version(uint32_t major, uint32_t minor, uint32_t subminor, uint32_t patch);
51 PEAK_COMMON_NO_DISCARD uint32_t
GetMajor()
const;
62 PEAK_COMMON_NO_DISCARD uint32_t
GetMinor()
const;
73 PEAK_COMMON_NO_DISCARD uint32_t
GetSubminor()
const;
84 PEAK_COMMON_NO_DISCARD uint32_t
GetPatch()
const;
94 PEAK_COMMON_NO_DISCARD
bool operator==(
const Version& other)
const
96 return std::tie(other.m_major, other.m_minor, other.m_subminor, other.m_patch)
97 == std::tie(this->m_major, this->m_minor, this->m_subminor, this->m_patch);
108 PEAK_COMMON_NO_DISCARD
bool operator!=(
const Version& other)
const
110 return !(*
this == other);
123 PEAK_COMMON_NO_DISCARD
bool operator<(
const Version& other)
const
125 return std::tie(this->m_major, this->m_minor, this->m_subminor, this->m_patch)
126 < std::tie(other.m_major, other.m_minor, other.m_subminor, other.m_patch);
137 PEAK_COMMON_NO_DISCARD
bool operator>(
const Version& other)
const
139 return other < *
this;
151 friend std::ostream&
operator<<(std::ostream& os, Version version)
153 return os << version.m_major <<
'.' << version.m_minor <<
'.' << version.m_subminor <<
'.' << version.m_patch;
163 PEAK_COMMON_NO_DISCARD std::string
ToString()
const
165 std::ostringstream ss;
171 friend detail::BackendAccessor<Version>;
173 explicit Version(
const detail::c_type_of_t<Version>& version)
174 :
Version(version.major, version.minor, version.subminor, version.patch)
177 explicit operator detail::c_type_of_t<Version>()
const
182 std::uint32_t m_major{};
183 std::uint32_t m_minor{};
184 std::uint32_t m_subminor{};
185 std::uint32_t m_patch{};
188inline Version::Version(uint32_t major, uint32_t minor, uint32_t subminor, uint32_t patch)
191 , m_subminor{ subminor }
Represents a structured version identifier with four components: major, minor, subminor,...
Definition peak_common_version.hpp:37
std::string ToString() const
Converts the version to its string representation (e.g., "1.2.3.4").
Definition peak_common_version.hpp:163
friend std::ostream & operator<<(std::ostream &os, Version version)
Outputs the version in dot-separated string format (e.g., "1.2.3.4").
Definition peak_common_version.hpp:151
uint32_t GetSubminor() const
Retrieves the subminor version component.
Definition peak_common_version.hpp:205
bool operator!=(const Version &other) const
Checks if two versions are not equal.
Definition peak_common_version.hpp:108
uint32_t GetPatch() const
Retrieves the patch version component.
Definition peak_common_version.hpp:210
bool operator>(const Version &other) const
Checks if this version is greater than another version.
Definition peak_common_version.hpp:137
uint32_t GetMajor() const
Retrieves the major version component.
Definition peak_common_version.hpp:195
uint32_t GetMinor() const
Retrieves the minor version component.
Definition peak_common_version.hpp:200
bool operator==(const Version &other) const
Checks if two versions are equal.
Definition peak_common_version.hpp:94
bool operator<(const Version &other) const
Checks if this version is less than another version.
Definition peak_common_version.hpp:123
Root namespace for common types and interfaces shared across multiple libraries.
Definition peak_common_math.hpp:22