rippled
Loading...
Searching...
No Matches
SemanticVersion.h
1#ifndef BEAST_MODULE_CORE_DIAGNOSTIC_SEMANTICVERSION_H_INCLUDED
2#define BEAST_MODULE_CORE_DIAGNOSTIC_SEMANTICVERSION_H_INCLUDED
3
4#include <string>
5#include <vector>
6
7namespace beast {
8
17{
18public:
20
24
27
29
30 SemanticVersion(std::string const& version);
31
36 bool
37 parse(std::string const& input);
38
41 print() const;
42
43 inline bool
44 isRelease() const noexcept
45 {
47 }
48 inline bool
49 isPreRelease() const noexcept
50 {
51 return !isRelease();
52 }
53};
54
58int
59compare(SemanticVersion const& lhs, SemanticVersion const& rhs);
60
61inline bool
63{
64 return compare(lhs, rhs) == 0;
65}
66
67inline bool
69{
70 return compare(lhs, rhs) != 0;
71}
72
73inline bool
75{
76 return compare(lhs, rhs) >= 0;
77}
78
79inline bool
80operator<=(SemanticVersion const& lhs, SemanticVersion const& rhs)
81{
82 return compare(lhs, rhs) <= 0;
83}
84
85inline bool
87{
88 return compare(lhs, rhs) > 0;
89}
90
91inline bool
92operator<(SemanticVersion const& lhs, SemanticVersion const& rhs)
93{
94 return compare(lhs, rhs) < 0;
95}
96
97} // namespace beast
98
99#endif
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)