From 51684c7207a119600c1f818baa13abc64d609690 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Mon, 12 Jan 2015 00:50:17 +0100 Subject: Improved error messages of VariantConverter --- src/core/common/VariantWriter.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/core/common/VariantWriter.cpp') diff --git a/src/core/common/VariantWriter.cpp b/src/core/common/VariantWriter.cpp index 713ec01..fc23359 100644 --- a/src/core/common/VariantWriter.cpp +++ b/src/core/common/VariantWriter.cpp @@ -16,6 +16,8 @@ along with this program. If not, see . */ +#include + #include "Variant.hpp" #include "VariantWriter.hpp" @@ -161,5 +163,14 @@ void VariantWriter::writeJson(const Variant &var, std::ostream &stream, { writeJsonInternal(var, stream, pretty, 0); } + +std::string VariantWriter::writeJsonToString(const Variant &var, bool pretty) +{ + std::stringstream ss; + writeJson(var, ss, pretty); + return ss.str(); +} + + } -- cgit v1.2.3