[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

@@ -1,7 +1,7 @@
#include "constant.hpp"
#include "collection.hpp"
#include <sstream>
#include <mbgl/util/string.hpp>
namespace mbgl {
namespace android {
@@ -24,9 +24,18 @@ Result<jni::Local<jni::Object<>>> Converter<jni::Local<jni::Object<>>, std::stri
}
Result<jni::Local<jni::Object<>>> Converter<jni::Local<jni::Object<>>, Color>::operator()(jni::JNIEnv& env, const Color& value) const {
std::stringstream sstream;
sstream << "rgba(" << value.r << ", " << value.g << ", " << value.b << ", " << value.a << ")";
return jni::Make<jni::String>(env, sstream.str());
std::string result;
result.reserve(32);
result += "rgba(";
result += util::toString(value.r);
result += ", ";
result += util::toString(value.g);
result += ", ";
result += util::toString(value.b);
result += ", ";
result += util::toString(value.a);
result += ")";
return jni::Make<jni::String>(env, result);
}
Result<jni::Local<jni::Object<>>> Converter<jni::Local<jni::Object<>>, style::expression::Formatted>::operator()(jni::JNIEnv& env, const style::expression::Formatted& value) const {