]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Added more comparison operators to HttpVersion.
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 23 Aug 2010 23:25:09 +0000 (17:25 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 23 Aug 2010 23:25:09 +0000 (17:25 -0600)
src/HttpVersion.h

index fb19b2b3bf3e03aba2c4d42e4f3608c17a10f18a..43952c91f132dcdf4ceb94d6ccc9e0ba025a2608 100644 (file)
@@ -66,6 +66,23 @@ public:
         return ((this->major != that.major) || (this->minor != that.minor));
     }
 
+    bool operator <(const HttpVersion& that) const {
+        return (this->major < that.major ||
+            this->major == that.major && this->minor < that.minor);
+    }
+
+    bool operator >(const HttpVersion& that) const {
+        return (this->major > that.major ||
+            this->major == that.major && this->minor > that.minor);
+    }
+
+    bool operator <=(const HttpVersion& that) const {
+        return !(*this > that);
+    }
+
+    bool operator >=(const HttpVersion& that) const {
+        return !(*this < that);
+    }
 };
 
 #endif /* SQUID_HTTPVERSION_H */