diff options
author | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2019-09-23 14:30:02 +0300 |
---|---|---|
committer | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2019-09-26 10:55:47 +0300 |
commit | 30ffbe9b8d49d8d8a2820f7b452ebc1d1531f298 (patch) | |
tree | 015177b4ed23075672df65e86a55675da94a6b79 /platform/default/src/mbgl/text/unaccent.cpp | |
parent | 7c2a7a263f9b3e90dd807ddd6d1dcbb783dec29b (diff) | |
download | qtlocation-mapboxgl-30ffbe9b8d49d8d8a2820f7b452ebc1d1531f298.tar.gz |
[core][android] Remove unaccent from platform interfaces
The unaccent is used only within collator, thus, there is no
need to have separate platform interface for it.
Diffstat (limited to 'platform/default/src/mbgl/text/unaccent.cpp')
-rw-r--r-- | platform/default/src/mbgl/text/unaccent.cpp | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/platform/default/src/mbgl/text/unaccent.cpp b/platform/default/src/mbgl/text/unaccent.cpp deleted file mode 100644 index 37b9a0d9ca..0000000000 --- a/platform/default/src/mbgl/text/unaccent.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include <mbgl/util/platform.hpp> -#include <libnu/unaccent.h> -#include <mbgl/text/unaccent.hpp> - -#include <cstring> -#include <sstream> - -namespace mbgl { namespace platform { - -std::string unaccent(const std::string& str) -{ - std::stringstream output; - char const *itr = str.c_str(), *nitr; - char const *end = itr + str.length(); - char lo[5] = { 0 }; - - for (; itr < end; itr = nitr) - { - uint32_t code_point = 0; - char const* buf = nullptr; - - nitr = _nu_tounaccent(itr, end, nu_utf8_read, &code_point, &buf, nullptr); - if (buf != nullptr) - { - do - { - buf = NU_CASEMAP_DECODING_FUNCTION(buf, &code_point); - if (code_point == 0) break; - output.write(lo, nu_utf8_write(code_point, lo) - lo); - } - while (code_point != 0); - } - else - { - output.write(itr, nitr - itr); - } - } - - return output.str(); -} - -} // namespace platform -} // namespace mbgl |