zeus::TAbstractHTTPData Class Reference

#include <AbstractHTTPData.h>

Inheritance diagram for zeus::TAbstractHTTPData:

zeus::TZObject zeus::IZUnknown zeus::THTTPRequest zeus::THTTPResponse

List of all members.

Public Types

enum  EGeneralProperty { etDate = 0, etPargma = 1, etMIMEVersion = 2 }
enum  EEntityProperty {
  etAllow = 0, etContentEncoding = 1, etContentLength = 2, etContentType = 3,
  etExpires = 4, etLastModified = 5, etContentLanguage = 6, etLink = 7,
  etTitle = 8, etURI = 9
}

Public Member Functions

 TAbstractHTTPData (THTTProtocol::EHTTPVersion eVersion)
virtual void reset ()
virtual Retval setGeneralProperty (EGeneralProperty eType, const IString &rValue)
virtual Retval setEntityProperty (EEntityProperty eType, const IString &rValue)
virtual void clearProperties ()
virtual TString getData () const
virtual TString getProperty (const IString &rName) const
virtual TString getProtocol () const
virtual THTTProtocol::EHTTPVersion getVersion () const
virtual bool hasProperties () const
virtual void setData (const IString &rData, bool bAddContentProperties=true)
virtual void setDataWithContentType (const IString &rData, const IString &rType)
virtual void setProperty (const IString &rName, const IString &rValue)

Protected Member Functions

virtual ~TAbstractHTTPData ()
void setVersion (THTTProtocol::EHTTPVersion eVersion)

Static Protected Member Functions

static void parsePropertyData (TAbstractHTTPData &rHTTPData, Uint &ulParseState, RToken &rToken, TString &rPropertyName, TString &rPropertyValue)
static bool scanHTTPData (char *pBuffer, Int iSize, TQueue< RToken > &rQueue)
static void printTokens (TQueue< RToken > rQueue)

Protected Attributes

TString m_strProtocol
 Protocol and Version number.
THTTProtocol::EHTTPVersion m_eVersion
 Used version of HTTP.
TString m_strData
 Data Body.
TStringList m_lstPropertyNames
 List of property names.
TStringMap< TStringm_mapProperties
 map of properties

Classes

struct  RToken


Detailed Description

This class implements the basic HTTP data package

Member Enumeration Documentation

This type defines general header fields (properties)

Enumerator:
etDate 
etPargma  Date field.
etMIMEVersion  Pragme field.

This type defines entity header fields (properties)

Enumerator:
etAllow 
etContentEncoding  Allow field.
etContentLength  Content-Encoding field.
etContentType  Content-Length field.
etExpires  Content-Type field.
etLastModified  Expires field.
etContentLanguage  Last-Modified field.
etLink  Content-Language field.
etTitle  Link field.
etURI  Title field.


Constructor & Destructor Documentation

TAbstractHTTPData::TAbstractHTTPData ( THTTProtocol::EHTTPVersion  eVersion  ) 

Creates a HTTP data package

TAbstractHTTPData::~TAbstractHTTPData (  )  [protected, virtual]

Destroys a HTTP data package


Member Function Documentation

void TAbstractHTTPData::reset (  )  [virtual]

Resets the request to default

Reimplemented in zeus::THTTPRequest, and zeus::THTTPResponse.

Retval TAbstractHTTPData::setGeneralProperty ( EGeneralProperty  eType,
const IString rValue 
) [virtual]

Sets the general property values

Retval TAbstractHTTPData::setEntityProperty ( EEntityProperty  eType,
const IString rValue 
) [virtual]

Sets the entity property values

void TAbstractHTTPData::clearProperties (  )  [virtual]

This will clear all propery entries of the http request

TString zeus::TAbstractHTTPData::getData (  )  const [inline, virtual]

Returns the data body

TString TAbstractHTTPData::getProperty ( const IString rName  )  const [virtual]

Returns the value of a named property

TString zeus::TAbstractHTTPData::getProtocol (  )  const [inline, virtual]

Returns the protocol string

THTTProtocol::EHTTPVersion zeus::TAbstractHTTPData::getVersion (  )  const [inline, virtual]

Returns the protocol version of the HTTP

bool zeus::TAbstractHTTPData::hasProperties (  )  const [inline, virtual]

Checks if there are any propierties

void TAbstractHTTPData::setData ( const IString rData,
bool  bAddContentProperties = true 
) [virtual]

Sets the data body

Parameters:
rData : Data buffer. Must be in octed stream
bAddContentProperties : Flag if the content type and the content lenght should be added

Reimplemented in zeus::THTTPRequest.

void TAbstractHTTPData::setDataWithContentType ( const IString rData,
const IString rType 
) [virtual]

Sets the data body with the content type header

void TAbstractHTTPData::setProperty ( const IString rName,
const IString rValue 
) [virtual]

Returns the value of a named property

void TAbstractHTTPData::setVersion ( THTTProtocol::EHTTPVersion  eVersion  )  [protected]

Returns the protocol version of the HTTP

void TAbstractHTTPData::parsePropertyData ( TAbstractHTTPData rHTTPData,
Uint &  rParseState,
RToken rToken,
TString rPropertyName,
TString rPropertyValue 
) [static, protected]

Helper method to parse the properies of the HTTP Package

bool TAbstractHTTPData::scanHTTPData ( char *  pBuffer,
Int  iSize,
TQueue< RToken > &  rQueue 
) [static, protected]

Internal Scanner to detect tokens and patterns of the incomming request.

Parameters:
pBuffer : Char Buffer
iSize,: Size of the buffer
rQueue : Queue to collect all tokens
Return values:
true : Scanning was successful
false : Scanning failed

void TAbstractHTTPData::printTokens ( TQueue< RToken rQueue  )  [static, protected]

Method for debugging the scanner


Member Data Documentation

Protocol and Version number.

Used version of HTTP.

Data Body.

List of property names.

map of properties


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


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Wed Oct 28 21:42:33 2009