xrpld
Loading...
Searching...
No Matches
SemanticVersion.h
1#pragma once
2
3#include <string>
4#include <string_view>
5#include <vector>
6
7namespace beast {
8
18{
19public:
21
25
28
30
32
38 bool
40
44 [[nodiscard]] std::string
45 print() const;
46
47 [[nodiscard]] bool
48 isRelease() const noexcept
49 {
50 return preReleaseIdentifiers.empty();
51 }
52 [[nodiscard]] bool
53 isPreRelease() const noexcept
54 {
55 return !isRelease();
56 }
57};
58
63int
64compare(SemanticVersion const& lhs, SemanticVersion const& rhs);
65
66inline bool
68{
69 return compare(lhs, rhs) == 0;
70}
71
72inline bool
74{
75 return compare(lhs, rhs) != 0;
76}
77
78inline bool
80{
81 return compare(lhs, rhs) >= 0;
82}
83
84inline bool
85operator<=(SemanticVersion const& lhs, SemanticVersion const& rhs)
86{
87 return compare(lhs, rhs) <= 0;
88}
89
90inline bool
92{
93 return compare(lhs, rhs) > 0;
94}
95
96inline bool
97operator<(SemanticVersion const& lhs, SemanticVersion const& rhs)
98{
99 return compare(lhs, rhs) < 0;
100}
101
102} // namespace beast
A Semantic Version number.
IdentifierList preReleaseIdentifiers
bool isPreRelease() const noexcept
bool parse(std::string_view input)
Parse a semantic version string.
std::string print() const
Produce a string from semantic version components.
bool isRelease() const noexcept
std::vector< std::string > IdentifierList
int compare(SemanticVersion const &lhs, SemanticVersion const &rhs)
Compare two SemanticVersions against each other.
bool operator<=(SemanticVersion const &lhs, SemanticVersion const &rhs)
bool operator>=(SemanticVersion const &lhs, SemanticVersion const &rhs)
bool operator>(SemanticVersion const &lhs, SemanticVersion const &rhs)
bool operator<(SemanticVersion const &lhs, SemanticVersion const &rhs)
bool operator==(LockFreeStackIterator< Container, LhsIsConst > const &lhs, LockFreeStackIterator< Container, RhsIsConst > const &rhs)
bool operator!=(LockFreeStackIterator< Container, LhsIsConst > const &lhs, LockFreeStackIterator< Container, RhsIsConst > const &rhs)