Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Types | Public Member Functions | Protected Types | Protected Attributes | List of all members
cHTTPMessage Class Reference

#include <HTTPMessage.h>

Inheritance diagram for cHTTPMessage:
Inheritance graph
[legend]

Public Types

enum  eKind { mkRequest, mkResponse }
 
enum  eStatus { HTTP_OK = 200, HTTP_BAD_REQUEST = 400 }
 

Public Member Functions

virtual void AddHeader (const AString &a_Key, const AString &a_Value)
 Adds a header into the internal map of headers. More...
 
 cHTTPMessage (eKind a_Kind)
 
size_t GetContentLength (void) const
 
const AStringGetContentType (void) const
 
void SetContentLength (size_t a_ContentLength)
 
void SetContentType (const AString &a_ContentType)
 
virtual ~cHTTPMessage ()
 

Protected Types

typedef std::map< AString, AStringcNameValueMap
 

Protected Attributes

size_t m_ContentLength
 Length of the content that is to be received. More...
 
AString m_ContentType
 Type of the content; parsed by AddHeader(), set directly by SetContentLength() More...
 
AStringMap m_Headers
 Map of headers, with their keys lowercased. More...
 
eKind m_Kind
 

Detailed Description

Definition at line 16 of file HTTPMessage.h.

Member Typedef Documentation

typedef std::map<AString, AString> cHTTPMessage::cNameValueMap
protected

Definition at line 46 of file HTTPMessage.h.

Member Enumeration Documentation

Enumerator
mkRequest 
mkResponse 

Definition at line 25 of file HTTPMessage.h.

Enumerator
HTTP_OK 
HTTP_BAD_REQUEST 

Definition at line 19 of file HTTPMessage.h.

Constructor & Destructor Documentation

cHTTPMessage::cHTTPMessage ( eKind  a_Kind)

Definition at line 26 of file HTTPMessage.cpp.

virtual cHTTPMessage::~cHTTPMessage ( )
inlinevirtual

Definition at line 34 of file HTTPMessage.h.

Member Function Documentation

void cHTTPMessage::AddHeader ( const AString a_Key,
const AString a_Value 
)
virtual

Adds a header into the internal map of headers.

Recognizes special headers: Content-Type and Content-Length

Reimplemented in cHTTPIncomingRequest.

Definition at line 36 of file HTTPMessage.cpp.

size_t cHTTPMessage::GetContentLength ( void  ) const
inline

Definition at line 43 of file HTTPMessage.h.

const AString& cHTTPMessage::GetContentType ( void  ) const
inline

Definition at line 42 of file HTTPMessage.h.

void cHTTPMessage::SetContentLength ( size_t  a_ContentLength)
inline

Definition at line 40 of file HTTPMessage.h.

void cHTTPMessage::SetContentType ( const AString a_ContentType)
inline

Definition at line 39 of file HTTPMessage.h.

Member Data Documentation

size_t cHTTPMessage::m_ContentLength
protected

Length of the content that is to be received.

AString::npos when the object is created. Parsed by AddHeader() or set directly by SetContentLength()

Definition at line 59 of file HTTPMessage.h.

AString cHTTPMessage::m_ContentType
protected

Type of the content; parsed by AddHeader(), set directly by SetContentLength()

Definition at line 54 of file HTTPMessage.h.

AStringMap cHTTPMessage::m_Headers
protected

Map of headers, with their keys lowercased.

Definition at line 51 of file HTTPMessage.h.

eKind cHTTPMessage::m_Kind
protected

Definition at line 48 of file HTTPMessage.h.


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