diff Framework/Toolbox/MessagingToolbox.cpp @ 309:14ef1227120f am-callable-and-promise

web services: better handling of failures
author am@osimis.io
date Fri, 28 Sep 2018 15:02:43 +0200
parents 5412adf19980
children b70e9be013e4
line wrap: on
line diff
--- a/Framework/Toolbox/MessagingToolbox.cpp	Tue Sep 25 15:14:53 2018 +0200
+++ b/Framework/Toolbox/MessagingToolbox.cpp	Fri Sep 28 15:02:43 2018 +0200
@@ -31,6 +31,7 @@
 
 #include <boost/lexical_cast.hpp>
 #include <json/reader.h>
+#include <json/writer.h>
 
 namespace OrthancStone
 {
@@ -114,6 +115,12 @@
                           target);
     }
 
+    void JsonToString(std::string& target,
+                      const Json::Value& source)
+    {
+      Json::FastWriter writer;
+      target = writer.write(source);
+    }
 
     static void ParseJsonException(Json::Value& target,
                                    const std::string& source)