From 1f459bc05a45ae25c0e68c9b28b14444f09a53d6 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Wed, 18 Feb 2015 16:33:18 +0100 Subject: added writeOusia methods to VariantWriter. --- src/core/common/VariantWriter.hpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/core/common/VariantWriter.hpp') diff --git a/src/core/common/VariantWriter.hpp b/src/core/common/VariantWriter.hpp index 7fe32fb..12f4bba 100644 --- a/src/core/common/VariantWriter.hpp +++ b/src/core/common/VariantWriter.hpp @@ -59,8 +59,28 @@ public: * @param var is the variant that should be serialized. * @param pretty if true, the resulting value is properly indented. */ - static std::string writeJsonToString(const Variant &var, bool pretty = true); + static std::string writeJsonToString(const Variant &var, + bool pretty = true); + /** + * Dumps the Variant as re-readable ousia data. Note that the resulting + * data is invalid if the Variant consists of function or object references. + * + * @param var is the variant that should be serialized. + * @param stream is the stream the result should be written to. + * @param pretty if true, the resulting value is properly indented. + */ + static void writeOusia(const Variant &var, std::ostream &stream, + bool pretty = true); + + /** + * Dumps the Variant as re-readable ousia data to a string. + * + * @param var is the variant that should be serialized. + * @param pretty if true, the resulting value is properly indented. + */ + static std::string writeOusiaToString(const Variant &var, + bool pretty = true); }; } -- cgit v1.2.3