xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
beast
core
SemanticVersion.h
1
#pragma once
2
3
#include <
string
>
4
#include <
string_view
>
5
#include <
vector
>
6
7
namespace
beast
{
8
17
class
SemanticVersion
18
{
19
public
:
20
using
IdentifierList
=
std::vector<std::string>
;
21
22
int
majorVersion
;
23
int
minorVersion
;
24
int
patchVersion
;
25
26
IdentifierList
preReleaseIdentifiers
;
27
IdentifierList
metaData
;
28
29
SemanticVersion
();
30
31
SemanticVersion
(
std::string_view
version);
32
38
bool
39
parse
(
std::string_view
input);
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
63
int
64
compare
(SemanticVersion
const
& lhs, SemanticVersion
const
& rhs);
65
66
inline
bool
67
operator==
(
SemanticVersion
const
& lhs,
SemanticVersion
const
& rhs)
68
{
69
return
compare
(lhs, rhs) == 0;
70
}
71
72
inline
bool
73
operator!=
(
SemanticVersion
const
& lhs,
SemanticVersion
const
& rhs)
74
{
75
return
compare
(lhs, rhs) != 0;
76
}
77
78
inline
bool
79
operator>=
(
SemanticVersion
const
& lhs,
SemanticVersion
const
& rhs)
80
{
81
return
compare
(lhs, rhs) >= 0;
82
}
83
84
inline
bool
85
operator<=
(
SemanticVersion
const
& lhs,
SemanticVersion
const
& rhs)
86
{
87
return
compare
(lhs, rhs) <= 0;
88
}
89
90
inline
bool
91
operator>
(
SemanticVersion
const
& lhs,
SemanticVersion
const
& rhs)
92
{
93
return
compare
(lhs, rhs) > 0;
94
}
95
96
inline
bool
97
operator<
(
SemanticVersion
const
& lhs,
SemanticVersion
const
& rhs)
98
{
99
return
compare
(lhs, rhs) < 0;
100
}
101
102
}
// namespace beast
std::string
std::string_view
beast::SemanticVersion
A Semantic Version number.
Definition
SemanticVersion.h:18
beast::SemanticVersion::metaData
IdentifierList metaData
Definition
SemanticVersion.h:27
beast::SemanticVersion::preReleaseIdentifiers
IdentifierList preReleaseIdentifiers
Definition
SemanticVersion.h:26
beast::SemanticVersion::majorVersion
int majorVersion
Definition
SemanticVersion.h:22
beast::SemanticVersion::minorVersion
int minorVersion
Definition
SemanticVersion.h:23
beast::SemanticVersion::patchVersion
int patchVersion
Definition
SemanticVersion.h:24
beast::SemanticVersion::isPreRelease
bool isPreRelease() const noexcept
Definition
SemanticVersion.h:53
beast::SemanticVersion::parse
bool parse(std::string_view input)
Parse a semantic version string.
Definition
libxrpl/beast/core/SemanticVersion.cpp:150
beast::SemanticVersion::print
std::string print() const
Produce a string from semantic version components.
Definition
libxrpl/beast/core/SemanticVersion.cpp:213
beast::SemanticVersion::SemanticVersion
SemanticVersion()
Definition
libxrpl/beast/core/SemanticVersion.cpp:139
beast::SemanticVersion::isRelease
bool isRelease() const noexcept
Definition
SemanticVersion.h:48
beast::SemanticVersion::IdentifierList
std::vector< std::string > IdentifierList
Definition
SemanticVersion.h:20
beast
Definition
base_uint.h:697
beast::compare
int compare(SemanticVersion const &lhs, SemanticVersion const &rhs)
Compare two SemanticVersions against each other.
Definition
libxrpl/beast/core/SemanticVersion.cpp:236
beast::operator<=
bool operator<=(SemanticVersion const &lhs, SemanticVersion const &rhs)
Definition
SemanticVersion.h:85
beast::operator>=
bool operator>=(SemanticVersion const &lhs, SemanticVersion const &rhs)
Definition
SemanticVersion.h:79
beast::operator>
bool operator>(SemanticVersion const &lhs, SemanticVersion const &rhs)
Definition
SemanticVersion.h:91
beast::operator<
bool operator<(SemanticVersion const &lhs, SemanticVersion const &rhs)
Definition
SemanticVersion.h:97
beast::operator==
bool operator==(LockFreeStackIterator< Container, LhsIsConst > const &lhs, LockFreeStackIterator< Container, RhsIsConst > const &rhs)
Definition
LockFreeStack.h:88
beast::operator!=
bool operator!=(LockFreeStackIterator< Container, LhsIsConst > const &lhs, LockFreeStackIterator< Container, RhsIsConst > const &rhs)
Definition
LockFreeStack.h:97
string
string_view
vector
Generated by
1.17.0