Files
MapLibreParticleLab/platform/default/string_stdlib.cpp
Konstantin Käfer cd9a89257a restructure gyp files
2014-10-24 16:40:08 +02:00

26 lines
747 B
C++

#include <mbgl/platform/platform.hpp>
#include <locale>
namespace mbgl {
namespace platform {
std::string uppercase(const std::string& string) {
// TODO: Use a proper Unicode Special Casing-aware algorithm.
const auto &convert = std::use_facet<std::ctype<char>>(std::locale());
std::string converted = string;
convert.toupper(&converted[0], &converted[0] + converted.size());
return converted;
}
std::string lowercase(const std::string& string) {
// TODO: Use a proper Unicode Special Casing-aware algorithm.
const auto &convert = std::use_facet<std::ctype<char>>(std::locale());
std::string converted = string;
convert.tolower(&converted[0], &converted[0] + converted.size());
return converted;
}
}
}