#include #include #include namespace mbgl { namespace platform { // Returns the path to the root folder of the application. const std::string &applicationRoot() { static const std::string root = []() -> std::string { size_t max = 0; std::string dir; do { // Gradually increase the length of the string in case the path was truncated. max += 256; dir.resize(max); uv_exepath(const_cast(dir.data()), &max); } while (max == dir.size()); dir.resize(max - 1); dir = dirname(const_cast(dir.c_str())); return dir; }(); return root; } } }