MythTV  0.28pre
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
HTTPRequest Class Referenceabstract

#include <httprequest.h>

Inheritance diagram for HTTPRequest:
Inheritance graph
[legend]
Collaboration diagram for HTTPRequest:
Collaboration graph
[legend]

Public Member Functions

 HTTPRequest ()
 
virtual ~HTTPRequest ()
 
bool ParseRequest ()
 
void FormatErrorResponse (bool bServerError, const QString &sFaultString, const QString &sDetails)
 
void FormatActionResponse (Serializer *ser)
 
void FormatActionResponse (const NameValues &pArgs)
 
void FormatFileResponse (const QString &sFileName)
 
void FormatRawResponse (const QString &sXML)
 
long SendResponse (void)
 
long SendResponseFile (QString sFileName)
 
QString GetHeaderValue (const QString &sKey, QString sDefault)
 
bool GetKeepAlive ()
 
SerializerGetSerializer ()
 
QString GetRequestProtocol () const
 
QString GetResponseProtocol () const
 
virtual qlonglong BytesAvailable ()=0
 
virtual qulonglong WaitForMore (int msecs, bool *timeout=NULL)=0
 
virtual bool CanReadLine ()=0
 
virtual QString ReadLine (int msecs=0)=0
 
virtual qlonglong ReadBlock (char *pData, qulonglong nMaxLen, int msecs=0)=0
 
virtual qlonglong WriteBlock (const char *pData, qulonglong nLen)=0
 
virtual qlonglong WriteBlockDirect (const char *pData, qulonglong nLen)=0
 
virtual QString GetHostAddress ()=0
 
virtual QString GetPeerAddress ()=0
 
virtual void Flush ()=0
 
virtual bool IsValid ()=0
 
virtual int getSocketHandle ()=0
 
virtual void SetBlocking (bool bBlock)=0
 
virtual bool IsBlocking ()=0
 

Static Public Member Functions

static QString GetMimeType (const QString &sFileExtension)
 
static QString TestMimeType (const QString &sFileName)
 
static long GetParameters (QString sParams, QStringMap &mapParams)
 
static QString Encode (const QString &sIn)
 
static QString GetETagHash (const QByteArray &data)
 

Public Attributes

RequestType m_eType
 
ContentType m_eContentType
 
QString m_sRawRequest
 
QString m_sBaseUrl
 
QString m_sResourceUrl
 
QString m_sMethod
 
QStringMap m_mapParams
 
QStringMap m_mapHeaders
 
QString m_sPayload
 
QString m_sProtocol
 
int m_nMajor
 
int m_nMinor
 
bool m_bProtected
 
bool m_bSOAPRequest
 
QString m_sNameSpace
 
ResponseType m_eResponseType
 
QString m_sResponseTypeText
 
long m_nResponseStatus
 
QStringMap m_mapRespHeaders
 
QString m_sFileName
 
QBuffer m_response
 
IPostProcessm_pPostProcess
 

Protected Member Functions

RequestType SetRequestType (const QString &sType)
 
void SetRequestProtocol (const QString &sLine)
 
ContentType SetContentType (const QString &sType)
 
void SetServerHeaders (void)
 
void ProcessRequestLine (const QString &sLine)
 
bool ProcessSOAPPayload (const QString &sSOAPAction)
 
void ExtractMethodFromURL ()
 
QString GetResponseStatus (void)
 
QString GetResponseType (void)
 
QString GetAdditionalHeaders (void)
 
bool ParseRange (QString sRange, long long llSize, long long *pllStart, long long *pllEnd)
 
QString BuildHeader (long long nSize)
 
qint64 SendData (QIODevice *pDevice, qint64 llStart, qint64 llBytes)
 
qint64 SendFile (QFile &file, qint64 llStart, qint64 llBytes)
 
bool IsUrlProtected (const QString &sBaseUrl)
 
bool Authenticated ()
 

Protected Attributes

QRegExp m_procReqLineExp
 
QRegExp m_parseRangeExp
 

Static Protected Attributes

static const char * m_szServerHeaders = "Accept-Ranges: bytes\r\n"
 

Detailed Description

Definition at line 96 of file httprequest.h.

Constructor & Destructor Documentation

HTTPRequest::HTTPRequest ( )

Definition at line 166 of file httprequest.cpp.

virtual HTTPRequest::~HTTPRequest ( )
inlinevirtual

Definition at line 176 of file httprequest.h.

Member Function Documentation

RequestType HTTPRequest::SetRequestType ( const QString &  sType)
protected

Definition at line 185 of file httprequest.cpp.

Referenced by ProcessRequestLine().

void HTTPRequest::SetRequestProtocol ( const QString &  sLine)
protected

Definition at line 844 of file httprequest.cpp.

Referenced by ProcessRequestLine().

ContentType HTTPRequest::SetContentType ( const QString &  sType)
protected

Definition at line 889 of file httprequest.cpp.

Referenced by ParseRequest().

void HTTPRequest::SetServerHeaders ( void  )
protected
void HTTPRequest::ProcessRequestLine ( const QString &  sLine)
protected

Definition at line 1309 of file httprequest.cpp.

Referenced by ParseRequest().

bool HTTPRequest::ProcessSOAPPayload ( const QString &  sSOAPAction)
protected

Definition at line 1506 of file httprequest.cpp.

Referenced by ParseRequest().

void HTTPRequest::ExtractMethodFromURL ( )
protected

Definition at line 1479 of file httprequest.cpp.

Referenced by ParseRequest().

QString HTTPRequest::GetResponseStatus ( void  )
protected

Definition at line 907 of file httprequest.cpp.

Referenced by BuildHeader(), and SendResponse().

QString HTTPRequest::GetResponseType ( void  )
protected

Definition at line 945 of file httprequest.cpp.

Referenced by BuildHeader().

QString HTTPRequest::GetAdditionalHeaders ( void  )
protected

Definition at line 1093 of file httprequest.cpp.

Referenced by BuildHeader().

bool HTTPRequest::ParseRange ( QString  sRange,
long long  llSize,
long long pllStart,
long long pllEnd 
)
protected

Definition at line 1377 of file httprequest.cpp.

Referenced by SendResponseFile().

QString HTTPRequest::BuildHeader ( long long  nSize)
protected

Definition at line 209 of file httprequest.cpp.

Referenced by SendResponse(), and SendResponseFile().

qint64 HTTPRequest::SendData ( QIODevice *  pDevice,
qint64  llStart,
qint64  llBytes 
)
protected

Definition at line 585 of file httprequest.cpp.

Referenced by SendFile(), and SendResponse().

qint64 HTTPRequest::SendFile ( QFile &  file,
qint64  llStart,
qint64  llBytes 
)
protected

Definition at line 636 of file httprequest.cpp.

Referenced by SendResponseFile().

bool HTTPRequest::IsUrlProtected ( const QString &  sBaseUrl)
protected

Definition at line 1680 of file httprequest.cpp.

Referenced by ParseRequest().

bool HTTPRequest::Authenticated ( )
protected

Definition at line 1699 of file httprequest.cpp.

Referenced by ParseRequest().

bool HTTPRequest::ParseRequest ( )

Definition at line 1142 of file httprequest.cpp.

Referenced by HttpWorker::run().

void HTTPRequest::FormatErrorResponse ( bool  bServerError,
const QString &  sFaultString,
const QString &  sDetails 
)

Definition at line 690 of file httprequest.cpp.

Referenced by UPnp::FormatErrorResponse().

void HTTPRequest::FormatActionResponse ( Serializer ser)
void HTTPRequest::FormatActionResponse ( const NameValues pArgs)

Definition at line 743 of file httprequest.cpp.

void HTTPRequest::FormatFileResponse ( const QString &  sFileName)
void HTTPRequest::FormatRawResponse ( const QString &  sXML)
long HTTPRequest::SendResponse ( void  )

Definition at line 251 of file httprequest.cpp.

Referenced by UPnp::FormatRedirectResponse(), and HttpWorker::run().

long HTTPRequest::SendResponseFile ( QString  sFileName)

Definition at line 416 of file httprequest.cpp.

Referenced by SendResponse().

QString HTTPRequest::GetHeaderValue ( const QString &  sKey,
QString  sDefault 
)
bool HTTPRequest::GetKeepAlive ( )

Definition at line 1117 of file httprequest.cpp.

Referenced by BuildHeader(), and HttpWorker::run().

Serializer * HTTPRequest::GetSerializer ( )

Definition at line 1612 of file httprequest.cpp.

Referenced by ServiceHost::FormatResponse().

QString HTTPRequest::GetRequestProtocol ( ) const

Definition at line 857 of file httprequest.cpp.

Referenced by ServerSideScripting::EvaluatePage().

QString HTTPRequest::GetResponseProtocol ( ) const

Definition at line 868 of file httprequest.cpp.

Referenced by BuildHeader().

QString HTTPRequest::GetMimeType ( const QString &  sFileExtension)
static
QString HTTPRequest::TestMimeType ( const QString &  sFileName)
static
long HTTPRequest::GetParameters ( QString  sParams,
QStringMap mapParams 
)
static
QString HTTPRequest::Encode ( const QString &  sIn)
static
QString HTTPRequest::GetETagHash ( const QByteArray &  data)
static

Definition at line 1669 of file httprequest.cpp.

virtual qlonglong HTTPRequest::BytesAvailable ( )
pure virtual

Implemented in BufferedSocketDeviceRequest.

Referenced by ParseRequest().

virtual qulonglong HTTPRequest::WaitForMore ( int  msecs,
bool timeout = NULL 
)
pure virtual

Implemented in BufferedSocketDeviceRequest.

virtual bool HTTPRequest::CanReadLine ( )
pure virtual

Implemented in BufferedSocketDeviceRequest.

virtual QString HTTPRequest::ReadLine ( int  msecs = 0)
pure virtual

Implemented in BufferedSocketDeviceRequest.

Referenced by ParseRequest().

virtual qlonglong HTTPRequest::ReadBlock ( char *  pData,
qulonglong  nMaxLen,
int  msecs = 0 
)
pure virtual

Implemented in BufferedSocketDeviceRequest.

Referenced by ParseRequest().

virtual qlonglong HTTPRequest::WriteBlock ( const char *  pData,
qulonglong  nLen 
)
pure virtual

Implemented in BufferedSocketDeviceRequest.

virtual qlonglong HTTPRequest::WriteBlockDirect ( const char *  pData,
qulonglong  nLen 
)
pure virtual
virtual QString HTTPRequest::GetHostAddress ( )
pure virtual
virtual QString HTTPRequest::GetPeerAddress ( )
pure virtual
virtual void HTTPRequest::Flush ( )
pure virtual

Implemented in BufferedSocketDeviceRequest.

virtual bool HTTPRequest::IsValid ( )
pure virtual

Implemented in BufferedSocketDeviceRequest.

virtual int HTTPRequest::getSocketHandle ( )
pure virtual
virtual void HTTPRequest::SetBlocking ( bool  bBlock)
pure virtual

Implemented in BufferedSocketDeviceRequest.

virtual bool HTTPRequest::IsBlocking ( )
pure virtual

Implemented in BufferedSocketDeviceRequest.

Member Data Documentation

const char * HTTPRequest::m_szServerHeaders = "Accept-Ranges: bytes\r\n"
staticprotected

Definition at line 100 of file httprequest.h.

Referenced by GetAdditionalHeaders().

QRegExp HTTPRequest::m_procReqLineExp
protected

Definition at line 102 of file httprequest.h.

Referenced by ProcessRequestLine().

QRegExp HTTPRequest::m_parseRangeExp
protected

Definition at line 103 of file httprequest.h.

Referenced by ParseRange().

RequestType HTTPRequest::m_eType
ContentType HTTPRequest::m_eContentType

Definition at line 108 of file httprequest.h.

Referenced by ParseRequest(), and SetContentType().

QString HTTPRequest::m_sRawRequest
QString HTTPRequest::m_sBaseUrl
QString HTTPRequest::m_sResourceUrl
QString HTTPRequest::m_sMethod
QStringMap HTTPRequest::m_mapParams
QStringMap HTTPRequest::m_mapHeaders
QString HTTPRequest::m_sPayload
QString HTTPRequest::m_sProtocol

Definition at line 121 of file httprequest.h.

Referenced by GetRequestProtocol(), and SetRequestProtocol().

int HTTPRequest::m_nMajor

Definition at line 122 of file httprequest.h.

Referenced by GetKeepAlive(), GetRequestProtocol(), ParseRequest(), and SetRequestProtocol().

int HTTPRequest::m_nMinor

Definition at line 123 of file httprequest.h.

Referenced by GetKeepAlive(), GetRequestProtocol(), ParseRequest(), and SetRequestProtocol().

bool HTTPRequest::m_bProtected

Definition at line 125 of file httprequest.h.

Referenced by GetAdditionalHeaders(), and ParseRequest().

bool HTTPRequest::m_bSOAPRequest
QString HTTPRequest::m_sNameSpace

Definition at line 128 of file httprequest.h.

Referenced by FormatActionResponse(), GetSerializer(), and ProcessSOAPPayload().

ResponseType HTTPRequest::m_eResponseType
QString HTTPRequest::m_sResponseTypeText
long HTTPRequest::m_nResponseStatus
QStringMap HTTPRequest::m_mapRespHeaders
QString HTTPRequest::m_sFileName
QBuffer HTTPRequest::m_response
IPostProcess* HTTPRequest::m_pPostProcess

Definition at line 142 of file httprequest.h.

Referenced by Eventing::HandleSubscribe(), and HttpWorker::run().


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