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
+8 -11
View File
@@ -33,25 +33,22 @@ public:
return !(*this > other);
}
bool process_operator(const std::string& op, const Version& other) const {
auto dep_op = Version::string_to_operator(op);
switch (dep_op) {
case DependencyVersionOperator::EQUAL:
bool processOperator(VersionOperator op, const Version& other) const {
switch (op) {
case VersionOperator::EQUAL:
return *this == other;
case DependencyVersionOperator::GREATHER:
case VersionOperator::GREATHER:
return *this > other;
case DependencyVersionOperator::LESS:
case VersionOperator::LESS:
return *this < other;
case DependencyVersionOperator::LESS_OR_EQUAL:
case VersionOperator::LESS_OR_EQUAL:
return *this <= other;
case DependencyVersionOperator::GREATHER_OR_EQUAL:
case VersionOperator::GREATHER_OR_EQUAL:
return *this >= other;
default:
return false;
}
}
static DependencyVersionOperator string_to_operator(const std::string& op);
static bool matches_pattern(const std::string& version);
static bool matchesPattern(const std::string& version);
};