#include <AbstractHTTPData.h>
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< TString > | m_mapProperties |
| map of properties | |
This class implements the basic HTTP data package
This type defines entity header fields (properties)
| TAbstractHTTPData::TAbstractHTTPData | ( | THTTProtocol::EHTTPVersion | eVersion ) |
Creates a HTTP data package
| TAbstractHTTPData::~TAbstractHTTPData | ( | ) | [protected, virtual] |
Destroys a HTTP data package
| 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
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
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.
| pBuffer | : Char Buffer |
| iSize,: | Size of the buffer |
| rQueue | : Queue to collect all tokens |
| true | : Scanning was successful |
| false | : Scanning failed |
| void TAbstractHTTPData::setData | ( | const IString & | rData, |
| bool | bAddContentProperties = true |
||
| ) | [virtual] |
Sets the data body
| 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
Returns the value of a named property
| void TAbstractHTTPData::setVersion | ( | THTTProtocol::EHTTPVersion | eVersion ) | [protected] |
Returns the protocol version of the HTTP
Used version of HTTP.
List of property names.
TStringMap<TString> zeus::TAbstractHTTPData::m_mapProperties [protected] |
map of properties
TString zeus::TAbstractHTTPData::m_strData [protected] |
Data Body.
TString zeus::TAbstractHTTPData::m_strProtocol [protected] |
Protocol and Version number.