From c9a75bdd2dca2c1d70b49c303e36388201f5e8b7 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Fri, 12 Dec 2014 02:16:43 +0100 Subject: fixed Variant::toString method --- src/core/common/Variant.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/core/common/Variant.cpp') diff --git a/src/core/common/Variant.cpp b/src/core/common/Variant.cpp index 27fc6e7..6b99add 100644 --- a/src/core/common/Variant.cpp +++ b/src/core/common/Variant.cpp @@ -138,9 +138,13 @@ Variant::stringType Variant::toString(bool escape) const return std::to_string(asDouble()); case Type::STRING: { // TODO: Use proper serialization function - std::stringstream ss; - ss << "\"" << asString() << "\""; - return ss.str(); + if (escape) { + std::stringstream ss; + ss << "\"" << asString() << "\""; + return ss.str(); + } else { + return asString(); + } } case Type::ARRAY: return Utils::join(asArray(), ", ", "[", "]"); -- cgit v1.2.3