diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2017-01-16 11:38:35 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2017-01-16 11:38:35 -0800 |
commit | 7ef2843e6a62116667be6a2c12de085951fdd5ea (patch) | |
tree | 40eca249e044e2706efd1193d617e6eb8e59d708 /include/mbgl/style | |
parent | 76301b252cbc4bc3ae1fc84322bcbcdbd26cae8a (diff) | |
parent | 13b97dd0cebffe36b187bdb74923910def6bd87b (diff) | |
download | qtlocation-mapboxgl-7ef2843e6a62116667be6a2c12de085951fdd5ea.tar.gz |
Merge branch 'release-ios-v3.4.0' into 1ec5-release-ios-v3.4.0-beta.7
Diffstat (limited to 'include/mbgl/style')
-rw-r--r-- | include/mbgl/style/filter.hpp | 60 | ||||
-rw-r--r-- | include/mbgl/style/sources/geojson_source.hpp | 2 | ||||
-rw-r--r-- | include/mbgl/style/sources/raster_source.hpp | 3 | ||||
-rw-r--r-- | include/mbgl/style/sources/vector_source.hpp | 3 |
4 files changed, 66 insertions, 2 deletions
diff --git a/include/mbgl/style/filter.hpp b/include/mbgl/style/filter.hpp index dd2b20cd0d..e5d8081d82 100644 --- a/include/mbgl/style/filter.hpp +++ b/include/mbgl/style/filter.hpp @@ -6,85 +6,143 @@ #include <string> #include <vector> +#include <tuple> namespace mbgl { namespace style { class Filter; -class NullFilter {}; +class NullFilter { +public: + friend bool operator==(const NullFilter&, const NullFilter&) { + return true; + } +}; class EqualsFilter { public: std::string key; Value value; + + friend bool operator==(const EqualsFilter& lhs, const EqualsFilter& rhs) { + return std::tie(lhs.key, lhs.value) == std::tie(rhs.key, rhs.value); + } }; class NotEqualsFilter { public: std::string key; Value value; + + friend bool operator==(const NotEqualsFilter& lhs, const NotEqualsFilter& rhs) { + return std::tie(lhs.key, lhs.value) == std::tie(rhs.key, rhs.value); + } }; class LessThanFilter { public: std::string key; Value value; + + friend bool operator==(const LessThanFilter& lhs, const LessThanFilter& rhs) { + return std::tie(lhs.key, lhs.value) == std::tie(rhs.key, rhs.value); + } }; class LessThanEqualsFilter { public: std::string key; Value value; + + friend bool operator==(const LessThanEqualsFilter& lhs, const LessThanEqualsFilter& rhs) { + return std::tie(lhs.key, lhs.value) == std::tie(rhs.key, rhs.value); + } }; class GreaterThanFilter { public: std::string key; Value value; + + friend bool operator==(const GreaterThanFilter& lhs, const GreaterThanFilter& rhs) { + return std::tie(lhs.key, lhs.value) == std::tie(rhs.key, rhs.value); + } }; class GreaterThanEqualsFilter { public: std::string key; Value value; + + friend bool operator==(const GreaterThanEqualsFilter& lhs, const GreaterThanEqualsFilter& rhs) { + return std::tie(lhs.key, lhs.value) == std::tie(rhs.key, rhs.value); + } }; class InFilter { public: std::string key; std::vector<Value> values; + + friend bool operator==(const InFilter& lhs, const InFilter& rhs) { + return std::tie(lhs.key, lhs.values) == std::tie(rhs.key, rhs.values); + } }; class NotInFilter { public: std::string key; std::vector<Value> values; + + friend bool operator==(const NotInFilter& lhs, const NotInFilter& rhs) { + return std::tie(lhs.key, lhs.values) == std::tie(rhs.key, rhs.values); + } }; class AnyFilter { public: std::vector<Filter> filters; + + friend bool operator==(const AnyFilter& lhs, const AnyFilter& rhs) { + return lhs.filters == rhs.filters; + } }; class AllFilter { public: std::vector<Filter> filters; + + friend bool operator==(const AllFilter& lhs, const AllFilter& rhs) { + return lhs.filters == rhs.filters; + } }; class NoneFilter { public: std::vector<Filter> filters; + + friend bool operator==(const NoneFilter& lhs, const NoneFilter& rhs) { + return lhs.filters == rhs.filters; + } }; class HasFilter { public: std::string key; + + friend bool operator==(const HasFilter& lhs, const HasFilter& rhs) { + return lhs.key == rhs.key; + } }; class NotHasFilter { public: std::string key; + + friend bool operator==(const NotHasFilter& lhs, const NotHasFilter& rhs) { + return lhs.key == rhs.key; + } }; using FilterBase = variant< diff --git a/include/mbgl/style/sources/geojson_source.hpp b/include/mbgl/style/sources/geojson_source.hpp index e633e6efba..ede0301725 100644 --- a/include/mbgl/style/sources/geojson_source.hpp +++ b/include/mbgl/style/sources/geojson_source.hpp @@ -43,7 +43,7 @@ public: void setURL(const std::string& url); void setGeoJSON(const GeoJSON&); - optional<std::string> getURL(); + optional<std::string> getURL() const; // Private implementation diff --git a/include/mbgl/style/sources/raster_source.hpp b/include/mbgl/style/sources/raster_source.hpp index 9bb951992c..395f25e51d 100644 --- a/include/mbgl/style/sources/raster_source.hpp +++ b/include/mbgl/style/sources/raster_source.hpp @@ -11,9 +11,12 @@ class RasterSource : public Source { public: RasterSource(std::string id, variant<std::string, Tileset> urlOrTileset, uint16_t tileSize); + optional<std::string> getURL() const; + // Private implementation class Impl; + Impl* const impl; }; template <> diff --git a/include/mbgl/style/sources/vector_source.hpp b/include/mbgl/style/sources/vector_source.hpp index e16a6a68af..8626ce160a 100644 --- a/include/mbgl/style/sources/vector_source.hpp +++ b/include/mbgl/style/sources/vector_source.hpp @@ -11,9 +11,12 @@ class VectorSource : public Source { public: VectorSource(std::string id, variant<std::string, Tileset> urlOrTileset); + optional<std::string> getURL() const; + // Private implementation class Impl; + Impl* const impl; }; template <> |