Classes | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes

zeus::TAbstractHTTPData Class Reference

#include <AbstractHTTPData.h>

Inheritance diagram for zeus::TAbstractHTTPData:
zeus::TZObject zeus::IZUnknown zeus::THTTPRequest zeus::THTTPResponse

List of all members.

Classes

struct  TypeToken

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, TypeToken &rToken, TString &rPropertyName, TString &rPropertyValue)
static bool scanHTTPData (char *pBuffer, Int iSize, TQueue< TypeToken > &rQueue)
static void printTokens (TQueue< TypeToken > 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

Detailed Description

This class implements the basic HTTP data package


Member Enumeration Documentation

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.

This type defines general header fields (properties)

Enumerator:
etDate 
etPargma 

Date field.

etMIMEVersion 

Pragme 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::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::parsePropertyData ( TAbstractHTTPData rHTTPData,
Uint &  rParseState,
TypeToken rToken,
TString rPropertyName,
TString rPropertyValue 
) [static, protected]

Helper method to parse the properies of the HTTP Package

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

Method for debugging the scanner

void TAbstractHTTPData::reset (  ) [virtual]

Resets the request to default

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

bool TAbstractHTTPData::scanHTTPData ( char *  pBuffer,
Int  iSize,
TQueue< TypeToken > &  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::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

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

Sets the entity property values

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

Sets the general property values

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


Member Data Documentation

Used version of HTTP.

List of property names.

map of properties

Data Body.

Protocol and Version number.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Sun Jan 22 2012 15:28:28