summaryrefslogtreecommitdiff
path: root/src
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 /src
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 'src')
-rw-r--r--src/core-files.json1
-rw-r--r--src/mbgl/style/expression/collator.cpp24
2 files changed, 25 insertions, 0 deletions
diff --git a/src/core-files.json b/src/core-files.json
index d881e6259d..2f609e92ec 100644
--- a/src/core-files.json
+++ b/src/core-files.json
@@ -178,6 +178,7 @@
"src/mbgl/style/expression/check_subtype.cpp",
"src/mbgl/style/expression/coalesce.cpp",
"src/mbgl/style/expression/coercion.cpp",
+ "src/mbgl/style/expression/collator.cpp",
"src/mbgl/style/expression/collator_expression.cpp",
"src/mbgl/style/expression/comparison.cpp",
"src/mbgl/style/expression/compound_expression.cpp",
diff --git a/src/mbgl/style/expression/collator.cpp b/src/mbgl/style/expression/collator.cpp
new file mode 100644
index 0000000000..185d713150
--- /dev/null
+++ b/src/mbgl/style/expression/collator.cpp
@@ -0,0 +1,24 @@
+#include <mbgl/style/expression/collator.hpp>
+
+namespace mbgl {
+namespace style {
+namespace expression {
+
+Collator::Collator(bool caseSensitive, bool diacriticSensitive, optional<std::string> locale)
+ : collator(platform::Collator(caseSensitive, diacriticSensitive, std::move(locale))) {}
+
+bool Collator::operator==(const Collator& other) const {
+ return collator == other.collator;
+}
+
+int Collator::compare(const std::string& lhs, const std::string& rhs) const {
+ return collator.compare(lhs, rhs);
+}
+
+std::string Collator::resolvedLocale() const {
+ return collator.resolvedLocale();
+}
+
+} // namespace expression
+} // namespace style
+} // namespace mbgl