Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / ACE / protocols / ace / INet / HTTP_Header.h
blobd4ab3f2a15d538fee711e1ef837069ce097ba688
1 /**
2 * @file HTTP_Header.h
4 * @author Martin Corino <mcorino@remedy.nl>
5 */
7 #ifndef ACE_HTTP_HEADER_H
8 #define ACE_HTTP_HEADER_H
10 #include /**/ "ace/pre.h"
12 #include /**/ "ace/config-all.h"
14 #if !defined (ACE_LACKS_PRAGMA_ONCE)
15 # pragma once
16 #endif /* ACE_LACKS_PRAGMA_ONCE */
18 #include "ace/INet/INet_Export.h"
19 #include "ace/INet/HeaderBase.h"
21 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
23 namespace ACE
25 namespace HTTP
27 /**
28 * @class ACE_HTTP_Header
30 * @brief Encapsulates common HTTP message properties.
33 class ACE_INET_Export Header
34 : public ACE::INet::HeaderBase
36 public:
37 /// Constructor
38 Header();
40 /// Constructor
41 Header(const ACE_CString& version);
43 /// Destructor
44 virtual ~Header();
46 /// Sets the HTTP version to use.
47 void set_version(const ACE_CString& version);
49 /// Returns the HTTP version.
50 const ACE_CString& get_version() const;
52 /// If flag is true, sets the Transfer-Encoding header to
53 /// CHUNKED_TRANSFER_ENCODING. Otherwise, removes the
54 /// Transfer-Encoding header.
55 void set_chunked_transfer_encoding(bool flag);
57 /// Returns true if the Transfer-Encoding header is set
58 /// and its value is CHUNKED_TRANSFER_ENCODING.
59 bool has_chunked_transfer_encoding() const;
61 /// Sets the value of the Connection header field.
62 /// The value is set to "Keep-Alive" if true
63 /// specified, or to "Close" otherwise.
64 void set_keep_alive(bool keep_alive);
66 /// Returns true if
67 /// * the message has a Connection header field and its value is "Keep-Alive"
68 /// * the message is a HTTP/1.1 message and no Connection header is set
69 /// Returns false otherwise.
70 bool has_keep_alive() const;
72 static const ACE_CString HTTP_1_0;
73 static const ACE_CString HTTP_1_1;
75 static const ACE_CString CHUNKED_TRANSFER_ENCODING;
77 static const ACE_CString TRANSFER_ENCODING;
78 static const ACE_CString CONNECTION;
80 static const ACE_CString CONNECTION_KEEP_ALIVE;
81 static const ACE_CString CONNECTION_CLOSE;
83 private:
84 ACE_CString version_;
89 ACE_END_VERSIONED_NAMESPACE_DECL
91 #if defined (__ACE_INLINE__)
92 #include "ace/INet/HTTP_Header.inl"
93 #endif
95 #include /**/ "ace/post.h"
96 #endif /* ACE_HTTP_HEADER_H */