Mercurial > hg > orthanc
comparison 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 |
comparison
equal
deleted
inserted
replaced
329:f579d50fdf8f | 330:78a8eaa5f30b |
---|---|
30 **/ | 30 **/ |
31 | 31 |
32 | 32 |
33 #pragma once | 33 #pragma once |
34 | 34 |
35 #include <list> | |
35 #include <string> | 36 #include <string> |
36 #include <stdint.h> | 37 #include <stdint.h> |
37 #include "../Enumerations.h" | 38 #include "../Enumerations.h" |
38 #include "HttpHandler.h" | 39 #include "HttpHandler.h" |
39 | 40 |
40 namespace Orthanc | 41 namespace Orthanc |
41 { | 42 { |
42 class HttpOutput | 43 class HttpOutput |
43 { | 44 { |
44 private: | 45 private: |
46 typedef std::list< std::pair<std::string, std::string> > Header; | |
47 | |
45 void SendHeaderInternal(Orthanc_HttpStatus status); | 48 void SendHeaderInternal(Orthanc_HttpStatus status); |
49 | |
50 void PrepareOkHeader(Header& header, | |
51 const char* contentType, | |
52 bool hasContentLength, | |
53 uint64_t contentLength, | |
54 const char* contentFilename); | |
55 | |
56 void SendOkHeader(const Header& header); | |
46 | 57 |
47 public: | 58 public: |
48 virtual ~HttpOutput() | 59 virtual ~HttpOutput() |
49 { | 60 { |
50 } | 61 } |
53 | 64 |
54 void SendOkHeader(const char* contentType, | 65 void SendOkHeader(const char* contentType, |
55 bool hasContentLength, | 66 bool hasContentLength, |
56 uint64_t contentLength, | 67 uint64_t contentLength, |
57 const char* contentFilename); | 68 const char* contentFilename); |
58 | |
59 void SendOkHeader(const HttpHandler::Arguments& header); | |
60 | 69 |
61 void SendString(const std::string& s); | 70 void SendString(const std::string& s); |
62 | 71 |
63 void SendMethodNotAllowedError(const std::string& allowed); | 72 void SendMethodNotAllowedError(const std::string& allowed); |
64 | 73 |
69 // Higher-level constructs to send entire buffers ---------------------------- | 78 // Higher-level constructs to send entire buffers ---------------------------- |
70 | 79 |
71 void AnswerBufferWithContentType(const std::string& buffer, | 80 void AnswerBufferWithContentType(const std::string& buffer, |
72 const std::string& contentType); | 81 const std::string& contentType); |
73 | 82 |
83 void AnswerBufferWithContentType(const std::string& buffer, | |
84 const std::string& contentType, | |
85 const HttpHandler::Arguments& cookies); | |
86 | |
74 void AnswerBufferWithContentType(const void* buffer, | 87 void AnswerBufferWithContentType(const void* buffer, |
75 size_t size, | 88 size_t size, |
76 const std::string& contentType); | 89 const std::string& contentType); |
77 }; | 90 }; |
78 } | 91 } |