diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-10-18 18:41:59 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2018-10-23 12:23:40 +0200 |
commit | 8bf66ef7a71ea220f2ed30ddd7feda28805dde41 (patch) | |
tree | 9d12b8b9c40b76a5334d00b145931151accdbb8e /src/mbgl/util | |
parent | 70d5972e104aac91f4198540d4af14562e92d555 (diff) | |
download | qtlocation-mapboxgl-8bf66ef7a71ea220f2ed30ddd7feda28805dde41.tar.gz |
[core] remove some uses of <iostream> and <sstream>
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 { |