This commit is contained in:
MihailRis
2025-09-22 00:06:21 +03:00
parent f02e6c65d8
commit 64b94a3e1b
6 changed files with 53 additions and 44 deletions
+1 -16
View File
@@ -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;