diff Core/HttpServer/HttpOutput.h @ 330:78a8eaa5f30b

cookies
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 09 Jan 2013 11:41:13 +0100
parents 64925c94825c
children 639272ef7615
line wrap: on
line diff
--- a/Core/HttpServer/HttpOutput.h	Tue Jan 08 14:56:10 2013 +0100
+++ b/Core/HttpServer/HttpOutput.h	Wed Jan 09 11:41:13 2013 +0100
@@ -32,6 +32,7 @@
 
 #pragma once
 
+#include <list>
 #include <string>
 #include <stdint.h>
 #include "../Enumerations.h"
@@ -42,8 +43,18 @@
   class HttpOutput
   {
   private:
+    typedef std::list< std::pair<std::string, std::string> >  Header;
+
     void SendHeaderInternal(Orthanc_HttpStatus status);
 
+    void PrepareOkHeader(Header& header,
+                         const char* contentType,
+                         bool hasContentLength,
+                         uint64_t contentLength,
+                         const char* contentFilename);
+
+    void SendOkHeader(const Header& header);
+
   public:
     virtual ~HttpOutput()
     {
@@ -56,8 +67,6 @@
                       uint64_t contentLength,
                       const char* contentFilename);
 
-    void SendOkHeader(const HttpHandler::Arguments& header);
-
     void SendString(const std::string& s);
 
     void SendMethodNotAllowedError(const std::string& allowed);
@@ -71,6 +80,10 @@
     void AnswerBufferWithContentType(const std::string& buffer,
                                      const std::string& contentType);
 
+    void AnswerBufferWithContentType(const std::string& buffer,
+                                     const std::string& contentType,
+                                     const HttpHandler::Arguments& cookies);
+
     void AnswerBufferWithContentType(const void* buffer,
                                      size_t size,
                                      const std::string& contentType);