20#include <xrpl/beast/core/LexicalCast.h>
21#include <xrpl/beast/core/SemanticVersion.h>
22#include <xrpl/beast/utility/instrumentation.h>
38 for (
auto const& x : list)
64 auto ret = input.
find(what);
81 input.
begin(), input.
end(), [](std::string::value_type c) {
82 return std::isdigit(c, std::locale::classic());
102 if (n < 0 || n > limit)
114 bool allowLeadingZeroes,
122 if (!allowLeadingZeroes && input[0] ==
'0')
126 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-");
132 value = input.
substr(0, last);
133 input.
erase(0, last);
140 bool allowLeadingZeroes,
153 }
while (
chop(
".", input));
161 : majorVersion(0), minorVersion(0), patchVersion(0)
176 input.
begin(), input.
end(), [](std::string::value_type c) {
177 return std::isspace(c, std::locale::classic());
183 [](std::string::value_type c) {
184 return std::isspace(c, std::locale::classic());
189 if (left_iter >= right_iter)
195 if (version != input)
201 if (!
chop(
".", version))
207 if (!
chop(
".", version))
215 if (
chop(
"-", version))
226 if (
chop(
"+", version))
236 return version.
empty();
312 isNumeric(right),
"beast::compare : both inputs numeric");
314 int const iLeft(lexicalCastThrow<int>(left));
315 int const iRight(lexicalCastThrow<int>(right));
319 else if (iLeft < iRight)
326 "beast::compare : both inputs non-numeric");
328 int result = left.compare(right);
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
T find_first_not_of(T... args)
int compare(SemanticVersion const &lhs, SemanticVersion const &rhs)
Compare two SemanticVersions against each other.
bool isNumeric(std::string const &s)
bool chop(std::string const &what, std::string &input)
std::string print_identifiers(SemanticVersion::identifier_list const &list)
bool extract_identifiers(SemanticVersion::identifier_list &identifiers, bool allowLeadingZeroes, std::string &input)
bool extract_identifier(std::string &value, bool allowLeadingZeroes, std::string &input)
bool lexicalCastChecked(Out &out, In in)
Intelligently convert from one type to another.
bool chopUInt(int &value, int limit, std::string &input)