1#include <xrpl/beast/core/LexicalCast.h>
2#include <xrpl/beast/core/SemanticVersion.h>
3#include <xrpl/beast/utility/instrumentation.h>
19 for (
auto const& x : list)
45 auto ret = input.
find(what);
62 return std::isdigit(c, std::locale::classic());
82 if (n < 0 || n > limit)
99 if (!allowLeadingZeroes && input[0] ==
'0')
103 input.
find_first_not_of(
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-");
109 value = input.
substr(0, last);
110 input.
erase(0, last);
117 bool allowLeadingZeroes,
130 }
while (
chop(
".", input));
152 return std::isspace(c, std::locale::classic());
156 return std::isspace(c, std::locale::classic());
160 if (left_iter >= right_iter)
166 if (version != input)
172 if (!
chop(
".", version))
178 if (!
chop(
".", version))
186 if (
chop(
"-", version))
197 if (
chop(
"+", version))
207 return version.
empty();
281 XRPL_ASSERT(
isNumeric(right),
"beast::compare : both inputs numeric");
283 int const iLeft(lexicalCastThrow<int>(left));
284 int const iRight(lexicalCastThrow<int>(right));
288 else if (iLeft < iRight)
293 XRPL_ASSERT(!
isNumeric(right),
"beast::compare : both inputs non-numeric");
295 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)