summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-12-26 13:58:56 -0800
committerMinh Nguyễn <mxn@1ec5.org>2016-12-26 13:58:56 -0800
commitddc4f5a14fa8662711b2cbd5069c71aa2bb187aa (patch)
tree9fde1776028a3182880b161d65542c6626f3e21c
parentf03cfd8bd50765556e76dcf11e9ae19c94a066cf (diff)
downloadqtlocation-mapboxgl-ddc4f5a14fa8662711b2cbd5069c71aa2bb187aa.tar.gz
[core] Added == operators for filter types
-rw-r--r--include/mbgl/style/filter.hpp59
1 files changed, 58 insertions, 1 deletions
diff --git a/include/mbgl/style/filter.hpp b/include/mbgl/style/filter.hpp
index dd2b20cd0d..33b14c3774 100644
--- a/include/mbgl/style/filter.hpp
+++ b/include/mbgl/style/filter.hpp
@@ -12,79 +12,136 @@ namespace style {
class Filter;
-class NullFilter {};
+class NullFilter {
+public:
+ bool operator==(const NullFilter&) const {
+ return true;
+ }
+};
class EqualsFilter {
public:
std::string key;
Value value;
+
+ bool operator==(const EqualsFilter& other) const {
+ return key == other.key && value == other.value;
+ }
};
class NotEqualsFilter {
public:
std::string key;
Value value;
+
+ bool operator==(const NotEqualsFilter& other) const {
+ return key == other.key && value == other.value;
+ }
};
class LessThanFilter {
public:
std::string key;
Value value;
+
+ bool operator==(const LessThanFilter& other) const {
+ return key == other.key && value == other.value;
+ }
};
class LessThanEqualsFilter {
public:
std::string key;
Value value;
+
+ bool operator==(const LessThanEqualsFilter& other) const {
+ return key == other.key && value == other.value;
+ }
};
class GreaterThanFilter {
public:
std::string key;
Value value;
+
+ bool operator==(const GreaterThanFilter& other) const {
+ return key == other.key && value == other.value;
+ }
};
class GreaterThanEqualsFilter {
public:
std::string key;
Value value;
+
+ bool operator==(const GreaterThanEqualsFilter& other) const {
+ return key == other.key && value == other.value;
+ }
};
class InFilter {
public:
std::string key;
std::vector<Value> values;
+
+ bool operator==(const InFilter& other) const {
+ return key == other.key && values == other.values;
+ }
};
class NotInFilter {
public:
std::string key;
std::vector<Value> values;
+
+ bool operator==(const NotInFilter& other) const {
+ return key == other.key && values == other.values;
+ }
};
class AnyFilter {
public:
std::vector<Filter> filters;
+
+ bool operator==(const AnyFilter& other) const {
+ return filters == other.filters;
+ }
};
class AllFilter {
public:
std::vector<Filter> filters;
+
+ bool operator==(const AllFilter& other) const {
+ return filters == other.filters;
+ }
};
class NoneFilter {
public:
std::vector<Filter> filters;
+
+ bool operator==(const NoneFilter& other) const {
+ return filters == other.filters;
+ }
};
class HasFilter {
public:
std::string key;
+
+ bool operator==(const HasFilter& other) const {
+ return key == other.key;
+ }
};
class NotHasFilter {
public:
std::string key;
+
+ bool operator==(const NotHasFilter& other) const {
+ return key == other.key;
+ }
};
using FilterBase = variant<