summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2019-09-23 15:42:06 +0300
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2019-09-26 10:55:47 +0300
commit9c8295c6a64b6f5b2c9b67fd01633a156481a3c8 (patch)
tree27cbdbff1757d0e4aa88c3616f17233a143270e2 /include
parent30ffbe9b8d49d8d8a2820f7b452ebc1d1531f298 (diff)
downloadqtlocation-mapboxgl-9c8295c6a64b6f5b2c9b67fd01633a156481a3c8.tar.gz
[core][android][darwin] Move platform specific Collator impls from expression
Platform specific Collator implementations should not be part of an expression APIs.
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/i18n/collator.hpp24
-rw-r--r--include/mbgl/style/expression/collator.hpp6
2 files changed, 26 insertions, 4 deletions
diff --git a/include/mbgl/i18n/collator.hpp b/include/mbgl/i18n/collator.hpp
new file mode 100644
index 0000000000..9db1f804aa
--- /dev/null
+++ b/include/mbgl/i18n/collator.hpp
@@ -0,0 +1,24 @@
+#pragma once
+
+#include <mbgl/util/optional.hpp>
+
+#include <memory>
+#include <string>
+
+namespace mbgl {
+namespace platform {
+
+class Collator {
+public:
+ explicit Collator(bool caseSensitive, bool diacriticSensitive, optional<std::string> locale = nullopt);
+ int compare(const std::string& lhs, const std::string& rhs) const;
+ std::string resolvedLocale() const;
+ bool operator==(const Collator& other) const;
+
+private:
+ class Impl;
+ std::shared_ptr<Impl> impl;
+};
+
+} // namespace platform
+} // namespace mbgl
diff --git a/include/mbgl/style/expression/collator.hpp b/include/mbgl/style/expression/collator.hpp
index 2a79e55556..51ba426fad 100644
--- a/include/mbgl/style/expression/collator.hpp
+++ b/include/mbgl/style/expression/collator.hpp
@@ -1,10 +1,9 @@
#pragma once
-#include <mbgl/util/feature.hpp>
+#include <mbgl/i18n/collator.hpp>
#include <mbgl/util/optional.hpp>
#include <string>
-#include <memory>
namespace mbgl {
namespace style {
@@ -20,8 +19,7 @@ public:
std::string resolvedLocale() const;
private:
- class Impl;
- std::shared_ptr<Impl> impl;
+ platform::Collator collator;
};
} // namespace expression