mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
cleanup
This commit is contained in:
parent
f02e6c65d8
commit
64b94a3e1b
6 changed files with 53 additions and 44 deletions
|
|
@ -26,26 +26,11 @@ Version::Version(const std::string& version) {
|
|||
if (parts.size() > 2) patch = parts[2];
|
||||
}
|
||||
|
||||
DependencyVersionOperator Version::string_to_operator(const std::string& op) {
|
||||
if (op == "=")
|
||||
return DependencyVersionOperator::EQUAL;
|
||||
else if (op == ">")
|
||||
return DependencyVersionOperator::GREATHER;
|
||||
else if (op == "<")
|
||||
return DependencyVersionOperator::LESS;
|
||||
else if (op == ">=" || op == "=>")
|
||||
return DependencyVersionOperator::GREATHER_OR_EQUAL;
|
||||
else if (op == "<=" || op == "=<")
|
||||
return DependencyVersionOperator::LESS_OR_EQUAL;
|
||||
else
|
||||
return DependencyVersionOperator::EQUAL;
|
||||
}
|
||||
|
||||
bool isNumber(const std::string& s) {
|
||||
return !s.empty() && std::all_of(s.begin(), s.end(), ::is_digit);
|
||||
}
|
||||
|
||||
bool Version::matches_pattern(const std::string& version) {
|
||||
bool Version::matchesPattern(const std::string& version) {
|
||||
for (char c : version) {
|
||||
if (!isdigit(c) && c != '.') {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue