[core] remove some uses of <iostream> and <sstream>

This commit is contained in:
Konstantin Käfer
2018-10-18 18:41:59 +02:00
parent 70d5972e10
commit 8bf66ef7a7
21 changed files with 61 additions and 56 deletions

View File

@@ -4,7 +4,6 @@
#include <mbgl/style/rapidjson_conversion.hpp>
#include <string>
#include <sstream>
namespace mbgl {
namespace style {
@@ -16,9 +15,7 @@ optional<T> convertJSON(const std::string& json, Error& error, Args&&...args) {
document.Parse<0>(json.c_str());
if (document.HasParseError()) {
std::stringstream message;
message << document.GetErrorOffset() << " - " << rapidjson::GetParseError_En(document.GetParseError());
error = { message.str() };
error = { formatJSONParseError(document) };
return {};
}

View File

@@ -18,7 +18,6 @@
#include <algorithm>
#include <set>
#include <sstream>
namespace mbgl {
namespace style {
@@ -30,11 +29,7 @@ StyleParseResult Parser::parse(const std::string& json) {
document.Parse<0>(json.c_str());
if (document.HasParseError()) {
std::stringstream message;
message << document.GetErrorOffset() << " - "
<< rapidjson::GetParseError_En(document.GetParseError());
return std::make_exception_ptr(std::runtime_error(message.str()));
return std::make_exception_ptr(std::runtime_error(formatJSONParseError(document)));
}
if (!document.IsObject()) {