diff Core/RestApi/RestApiOutput.h @ 1046:00f9f36bcd94

on-the-fly conversion of JSON to XML according to HTTP Accept
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 18 Jul 2014 17:15:34 +0200
parents 8d1845feb277
children ba5c0908600c
line wrap: on
line diff
--- a/Core/RestApi/RestApiOutput.h	Fri Jul 18 16:41:10 2014 +0200
+++ b/Core/RestApi/RestApiOutput.h	Fri Jul 18 17:15:34 2014 +0200
@@ -44,6 +44,7 @@
   private:
     HttpOutput& output_;
     bool alreadySent_;
+    bool convertJsonToXml_;
 
     void CheckStatus();
 
@@ -62,6 +63,16 @@
       alreadySent_ = true;
     }
 
+    void SetConvertJsonToXml(bool convert)
+    {
+      convertJsonToXml_ = convert;
+    }
+
+    bool IsConvertJsonToXml() const
+    {
+      return convertJsonToXml_;
+    }
+
     void AnswerFile(HttpFileSender& sender);
 
     void AnswerJson(const Json::Value& value);