ACE_INet  6.2.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
ACE::HTTP::Header Class Reference

#include <HTTP_Header.h>

Inheritance diagram for ACE::HTTP::Header:
Inheritance graph
Collaboration diagram for ACE::HTTP::Header:
Collaboration graph

Public Member Functions

 Header ()
 Constructor. More...
 
 Header (const ACE_CString &version)
 Constructor. More...
 
virtual ~Header ()
 Destructor. More...
 
void set_version (const ACE_CString &version)
 Sets the HTTP version to use. More...
 
const ACE_CStringget_version () const
 Returns the HTTP version. More...
 
void set_chunked_transfer_encoding (bool flag)
 
bool has_chunked_transfer_encoding () const
 
void set_keep_alive (bool keep_alive)
 
bool has_keep_alive () const
 
- Public Member Functions inherited from ACE::INet::HeaderBase
 HeaderBase ()
 Constructor. More...
 
virtual ~HeaderBase ()
 Destructor. More...
 
virtual void set_content_length (int length)
 
virtual int get_content_length () const
 
virtual void set_content_type (const ACE_CString &mime_type)
 
virtual ACE_CString get_content_type () const
 
void clear ()
 
virtual void write (std::ostream &str) const
 Writes the headers to the given stream. More...
 
virtual bool read (std::istream &str)
 
void set (const ACE_CString &name, const ACE_CString &value)
 Sets header name to value. Overwrites existing vaues. More...
 
void add (const ACE_CString &name, const ACE_CString &value)
 Adds header name with value. Allows duplicates. More...
 
void remove (const ACE_CString &name)
 Removes header name (first found). More...
 
bool get (const ACE_CString &name, ACE_CString &value) const
 Retrieves value for header name into value (first found). More...
 
bool has (const ACE_CString &name) const
 Returns true if a header name exists (1 or more), false otherwise. More...
 
void get_values (const ACE_CString &name, ACE_Array< ACE_CString > &values) const
 Retrieves values for all headers name into values. More...
 

Static Public Attributes

static const ACE_CString HTTP_1_0 = "HTTP/1.0"
 
static const ACE_CString HTTP_1_1 = "HTTP/1.1"
 
static const ACE_CString CHUNKED_TRANSFER_ENCODING = "chunked"
 
static const ACE_CString TRANSFER_ENCODING = "Transfer-Encoding"
 
static const ACE_CString CONNECTION = "Connection"
 
static const ACE_CString CONNECTION_KEEP_ALIVE = "Keep-Alive"
 
static const ACE_CString CONNECTION_CLOSE = "Close"
 
- Static Public Attributes inherited from ACE::INet::HeaderBase
static const int UNKNOWN_CONTENT_LENGTH = -1
 
static const ACE_CString UNKNOWN_CONTENT_TYPE
 
static const ACE_CString CONTENT_LENGTH = "Content-Length"
 
static const ACE_CString CONTENT_TYPE = "Content-Type"
 
static const ACE_CString EMPTY
 

Private Attributes

ACE_CString version_
 

Additional Inherited Members

- Protected Member Functions inherited from ACE::INet::HeaderBase
int read_field (std::istream &str, ACE_CString &var, size_t maxlen, char delim)
 
int read_ws_field (std::istream &str, ACE_CString &var, size_t maxlen)
 
- Static Protected Attributes inherited from ACE::INet::HeaderBase
static const int eof_ = std::char_traits<char>::eof()
 

Constructor & Destructor Documentation

ACE::HTTP::Header::Header ( )

Constructor.

ACE::HTTP::Header::Header ( const ACE_CString version)

Constructor.

ACE::HTTP::Header::~Header ( )
virtual

Destructor.

Member Function Documentation

const ACE_CString & ACE::HTTP::Header::get_version ( ) const
inline

Returns the HTTP version.

bool ACE::HTTP::Header::has_chunked_transfer_encoding ( ) const
inline

Returns true if the Transfer-Encoding header is set and its value is CHUNKED_TRANSFER_ENCODING.

bool ACE::HTTP::Header::has_keep_alive ( ) const
inline

Returns true if

  • the message has a Connection header field and its value is "Keep-Alive"
  • the message is a HTTP/1.1 message and no Connection header is set Returns false otherwise.
void ACE::HTTP::Header::set_chunked_transfer_encoding ( bool  flag)
inline

If flag is true, sets the Transfer-Encoding header to CHUNKED_TRANSFER_ENCODING. Otherwise, removes the Transfer-Encoding header.

void ACE::HTTP::Header::set_keep_alive ( bool  keep_alive)
inline

Sets the value of the Connection header field. The value is set to "Keep-Alive" if true specified, or to "Close" otherwise.

void ACE::HTTP::Header::set_version ( const ACE_CString version)
inline

Sets the HTTP version to use.

Member Data Documentation

const ACE_CString ACE::HTTP::Header::CHUNKED_TRANSFER_ENCODING = "chunked"
static
const ACE_CString ACE::HTTP::Header::CONNECTION = "Connection"
static
const ACE_CString ACE::HTTP::Header::CONNECTION_CLOSE = "Close"
static
const ACE_CString ACE::HTTP::Header::CONNECTION_KEEP_ALIVE = "Keep-Alive"
static
const ACE_CString ACE::HTTP::Header::HTTP_1_0 = "HTTP/1.0"
static
const ACE_CString ACE::HTTP::Header::HTTP_1_1 = "HTTP/1.1"
static
const ACE_CString ACE::HTTP::Header::TRANSFER_ENCODING = "Transfer-Encoding"
static
ACE_CString ACE::HTTP::Header::version_
private

The documentation for this class was generated from the following files: