summaryrefslogtreecommitdiff
path: root/src/core/common/VariantWriter.cpp
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-12 00:50:17 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-12 00:50:17 +0100
commit51684c7207a119600c1f818baa13abc64d609690 (patch)
tree1afd5c499df3e1f844509b34c8f0453382ce24d5 /src/core/common/VariantWriter.cpp
parente9a0eaaef261b99e0a1e605f3c77285eeaa2bddd (diff)
Improved error messages of VariantConverter
Diffstat (limited to 'src/core/common/VariantWriter.cpp')
-rw-r--r--src/core/common/VariantWriter.cpp11
1 files changed, 11 insertions, 0 deletions
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 <http://www.gnu.org/licenses/>.
*/
+#include <sstream>
+
#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();
+}
+
+
}