20 #include <ripple/beast/core/SemanticVersion.h>
21 #include <ripple/beast/core/LexicalCast.h>
33 for (
auto const& x : list)
57 auto ret = input.
find (what);
73 [](std::string::value_type c)
75 return std::isdigit (c, std::locale::classic());
95 if (n < 0 || n > limit)
112 if (!allowLeadingZeroes && input [0] ==
'0')
116 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-");
122 value = input.
substr (0, last);
123 input.
erase (0, last);
129 bool allowLeadingZeroes,
141 }
while (
chop (
".", input));
158 if (!
parse (version))
166 [](std::string::value_type c)
168 return std::isspace (c, std::locale::classic());
172 [](std::string::value_type c)
174 return std::isspace (c, std::locale::classic());
178 if (left_iter >= right_iter)
184 if (version != input)
190 if (!
chop (
".", version))
196 if (!
chop (
".", version))
204 if (
chop (
"-", version))
215 if (
chop (
"+", version))
225 return version.
empty ();
298 int const iLeft (lexicalCastThrow <int> (left));
299 int const iRight (lexicalCastThrow <int> (right));
303 else if (iLeft < iRight)
310 int result = left.compare (right);
bool isRelease() const noexcept
bool chop(std::string const &what, std::string &input)
std::string print() const
Produce a string from semantic version components.
bool extract_identifier(std::string &value, bool allowLeadingZeroes, std::string &input)
int compare(SemanticVersion const &lhs, SemanticVersion const &rhs)
Compare two SemanticVersions against each other.
bool isPreRelease() const noexcept
A Semantic Version number.
T find_first_not_of(T... args)
identifier_list preReleaseIdentifiers
bool chopUInt(int &value, int limit, std::string &input)
bool parse(std::string const &input)
Parse a semantic version string.
bool extract_identifiers(SemanticVersion::identifier_list &identifiers, bool allowLeadingZeroes, std::string &input)
bool lexicalCastChecked(Out &out, In in)
Intelligently convert from one type to another.
std::string print_identifiers(SemanticVersion::identifier_list const &list)
bool isNumeric(std::string const &s)