diff options
Diffstat (limited to 'src/mbgl/util')
-rw-r--r-- | src/mbgl/util/mapbox.cpp | 1 | ||||
-rw-r--r-- | src/mbgl/util/rapidjson.cpp | 13 | ||||
-rw-r--r-- | src/mbgl/util/rapidjson.hpp | 2 | ||||
-rw-r--r-- | src/mbgl/util/stopwatch.cpp | 1 | ||||
-rw-r--r-- | src/mbgl/util/stopwatch.hpp | 3 |
5 files changed, 18 insertions, 2 deletions
diff --git a/src/mbgl/util/mapbox.cpp b/src/mbgl/util/mapbox.cpp index b823b727a7..6c36c152cd 100644 --- a/src/mbgl/util/mapbox.cpp +++ b/src/mbgl/util/mapbox.cpp @@ -6,7 +6,6 @@ #include <stdexcept> #include <vector> -#include <iostream> #include <cstring> namespace { diff --git a/src/mbgl/util/rapidjson.cpp b/src/mbgl/util/rapidjson.cpp new file mode 100644 index 0000000000..32a3c0b929 --- /dev/null +++ b/src/mbgl/util/rapidjson.cpp @@ -0,0 +1,13 @@ +#include <mbgl/util/rapidjson.hpp> +#include <mbgl/util/string.hpp> + +namespace mbgl { + +std::string formatJSONParseError(const JSDocument& doc) { + return std::string{ rapidjson::GetParseError_En(doc.GetParseError()) } + " at offset " + + util::toString(doc.GetErrorOffset()); +} + +} // namespace mbgl + + diff --git a/src/mbgl/util/rapidjson.hpp b/src/mbgl/util/rapidjson.hpp index 7262e8545c..2fb2a07c9f 100644 --- a/src/mbgl/util/rapidjson.hpp +++ b/src/mbgl/util/rapidjson.hpp @@ -8,4 +8,6 @@ namespace mbgl { using JSDocument = rapidjson::GenericDocument<rapidjson::UTF8<>, rapidjson::CrtAllocator>; using JSValue = rapidjson::GenericValue<rapidjson::UTF8<>, rapidjson::CrtAllocator>; +std::string formatJSONParseError(const JSDocument&); + } // namespace mbgl diff --git a/src/mbgl/util/stopwatch.cpp b/src/mbgl/util/stopwatch.cpp index 3883d8535f..6db9da07e1 100644 --- a/src/mbgl/util/stopwatch.cpp +++ b/src/mbgl/util/stopwatch.cpp @@ -4,7 +4,6 @@ #include <mbgl/util/chrono.hpp> #include <mbgl/util/logging.hpp> -#include <iostream> #include <atomic> namespace mbgl { diff --git a/src/mbgl/util/stopwatch.hpp b/src/mbgl/util/stopwatch.hpp index 0c91342a57..daa313f702 100644 --- a/src/mbgl/util/stopwatch.hpp +++ b/src/mbgl/util/stopwatch.hpp @@ -4,7 +4,10 @@ #include <mbgl/util/chrono.hpp> #include <string> + +#ifdef MBGL_TIMING #include <sstream> +#endif namespace mbgl { namespace util { |