1#include <xrpl/beast/core/SemanticVersion.h>
3#include <xrpl/beast/core/LexicalCast.h>
4#include <xrpl/beast/utility/instrumentation.h>
22 for (
auto const& x : list)
48 auto ret = input.
find(what);
84 if (n < 0 || n > limit)
101 if (!allowLeadingZeroes && input[0] ==
'0')
105 input.
find_first_not_of(
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-");
111 value = input.
substr(0, last);
112 input.
erase(0, last);
119 bool allowLeadingZeroes,
132 }
while (
chop(
".", input));
162 if (leftIter >= rightIter)
168 if (version != input)
174 if (!
chop(
".", version))
180 if (!
chop(
".", version))
188 if (
chop(
"-", version))
199 if (
chop(
"+", version))
209 return version.
empty();
307 XRPL_ASSERT(
isNumeric(right),
"beast::compare : both inputs numeric");
323 XRPL_ASSERT(!
isNumeric(right),
"beast::compare : both inputs non-numeric");
325 int const result = left.compare(right);
A Semantic Version number.
identifier_list preReleaseIdentifiers
bool isPreRelease() const noexcept
bool parse(std::string_view input)
Parse a semantic version string.
std::string print() const
Produce a string from semantic version components.
std::vector< std::string > identifier_list
bool isRelease() const noexcept
T find_first_not_of(T... args)
Out lexicalCastThrow(In in)
Convert from one type to another, throw on error.
int compare(SemanticVersion const &lhs, SemanticVersion const &rhs)
Compare two SemanticVersions against each other.
bool isNumeric(std::string const &s)
std::string printIdentifiers(SemanticVersion::identifier_list const &list)
bool chop(std::string const &what, std::string &input)
bool extractIdentifier(std::string &value, bool allowLeadingZeroes, std::string &input)
bool extractIdentifiers(SemanticVersion::identifier_list &identifiers, 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)