rippled
Loading...
Searching...
No Matches
SemanticVersion.h
1#pragma once
2
3#include <string>
4#include <vector>
5
6namespace beast {
7
16{
17public:
19
23
26
28
29 SemanticVersion(std::string const& version);
30
35 bool
36 parse(std::string const& input);
37
40 print() const;
41
42 inline bool
43 isRelease() const noexcept
44 {
46 }
47 inline bool
48 isPreRelease() const noexcept
49 {
50 return !isRelease();
51 }
52};
53
57int
58compare(SemanticVersion const& lhs, SemanticVersion const& rhs);
59
60inline bool
62{
63 return compare(lhs, rhs) == 0;
64}
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
79operator<=(SemanticVersion const& lhs, SemanticVersion const& rhs)
80{
81 return compare(lhs, rhs) <= 0;
82}
83
84inline bool
86{
87 return compare(lhs, rhs) > 0;
88}
89
90inline bool
91operator<(SemanticVersion const& lhs, SemanticVersion const& rhs)
92{
93 return compare(lhs, rhs) < 0;
94}
95
96} // namespace beast
A Semantic Version number.
bool parse(std::string const &input)
Parse a semantic version string.
identifier_list preReleaseIdentifiers
bool isPreRelease() const noexcept
std::string print() const
Produce a string from semantic version components.
bool isRelease() const noexcept
identifier_list metaData
T empty(T... args)
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)