Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / protocols / ace / INet / HTTP_Response.h
blobf7343b970ece0bd2ebbaaa104c4b71cf72b21956
1 /**
2 * @file HTTP_Response.h
4 * @author Martin Corino <mcorino@remedy.nl>
5 */
7 #ifndef ACE_HTTP_RESPONSE_H
8 #define ACE_HTTP_RESPONSE_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/Containers_T.h"
19 #include "ace/INet/INet_Export.h"
20 #include "ace/INet/Response.h"
21 #include "ace/INet/HTTP_Header.h"
22 #include "ace/INet/HTTP_Status.h"
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
26 namespace ACE
28 namespace HTTP
30 /**
31 * @class ACE_HTTP_Response
33 * @brief Encapsulates HTTP response message properties.
36 class ACE_INET_Export Response
37 : public ACE::INet::Response, public Header
39 public:
40 /// Constructor
41 Response();
43 Response(const Status& status);
45 Response(const ACE_CString& version, const Status& status = Status());
47 /// Destructor
48 virtual ~Response();
50 /// Reset the response object
51 void reset ();
53 void reset (const Status& status);
55 void reset (const ACE_CString& version, const Status& status = Status());
57 /// Set the status.
58 void set_status(const Status& status);
60 /// Return the status.
61 const Status& get_status() const;
63 /// Adds a Cookie header.
64 void add_cookie(const ACE_CString& cookie);
66 /// Get cookies from Cookie header(s)).
67 void get_cookies(ACE_Array<ACE_CString> & cookies) const;
69 /// Writes the HTTP response to the given stream
70 virtual void write(std::ostream& str) const;
72 /// Reads the HTTP response from the
73 /// given stream.
74 /// 100 Continue responses are ignored.
75 virtual bool read(std::istream& str);
77 static const ACE_CString COOKIE;
79 private:
80 enum Limits
82 MAX_VERSION_LENGTH = 8,
83 MAX_STATUS_LENGTH = 3,
84 MAX_REASON_LENGTH = 512
87 Status status_;
92 ACE_END_VERSIONED_NAMESPACE_DECL
94 #if defined (__ACE_INLINE__)
95 #include "ace/INet/HTTP_Response.inl"
96 #endif
98 #include /**/ "ace/post.h"
99 #endif /* ACE_HTTP_RESPONSE_H */