#ifndef MBGL_UTIL_STRING #define MBGL_UTIL_STRING #include #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunknown-pragmas" #pragma GCC diagnostic ignored "-Wunused-local-typedefs" #include #pragma GCC diagnostic pop namespace mbgl { namespace util { template inline std::string toString(Args&&... args) { return boost::lexical_cast(::std::forward(args)...); } // boost::lexical_cast() treats this as a character, but we are using it as number types. inline std::string toString(int8_t num) { return boost::lexical_cast(int(num)); } template inline std::string sprintf(const char *msg, Args... args) { char res[max]; int len = snprintf(res, sizeof(res), msg, args...); return std::string(res, len); } template inline std::string sprintf(const std::string &msg, Args... args) { return sprintf(msg.c_str(), args...); } } } #endif