Eneboo - Documentación para desarrolladores
Métodos públicos | Métodos protegidos
Referencia de la Clase QHttpHeader

The QHttpHeader class contains header information for HTTP.network. Más...

#include <qhttp.h>

Diagrama de herencias de QHttpHeader
QHttpRequestHeader QHttpRequestHeader QHttpResponseHeader QHttpResponseHeader

Lista de todos los miembros.

Métodos públicos

 QHttpHeader ()
 QHttpHeader (const QHttpHeader &header)
 QHttpHeader (const QString &str)
virtual ~QHttpHeader ()
QHttpHeaderoperator= (const QHttpHeader &h)
QString value (const QString &key) const
void setValue (const QString &key, const QString &value)
void removeValue (const QString &key)
QStringList keys () const
bool hasKey (const QString &key) const
bool hasContentLength () const
uint contentLength () const
void setContentLength (int len)
bool hasContentType () const
QString contentType () const
void setContentType (const QString &type)
virtual QString toString () const
bool isValid () const
virtual int majorVersion () const =0
virtual int minorVersion () const =0
 QHttpHeader ()
 QHttpHeader (const QHttpHeader &header)
 QHttpHeader (const QString &str)
virtual ~QHttpHeader ()
QHttpHeaderoperator= (const QHttpHeader &h)
QString value (const QString &key) const
void setValue (const QString &key, const QString &value)
void removeValue (const QString &key)
QStringList keys () const
bool hasKey (const QString &key) const
bool hasContentLength () const
uint contentLength () const
void setContentLength (int len)
bool hasContentType () const
QString contentType () const
void setContentType (const QString &type)
virtual QString toString () const
bool isValid () const
virtual int majorVersion () const =0
virtual int minorVersion () const =0

Métodos protegidos

virtual bool parseLine (const QString &line, int number)
bool parse (const QString &str)
void setValid (bool)
virtual bool parseLine (const QString &line, int number)
bool parse (const QString &str)
void setValid (bool)

Descripción detallada

The QHttpHeader class contains header information for HTTP.

network.

In most cases you should use the more specialized derivatives of this class, QHttpResponseHeader and QHttpRequestHeader, rather than directly using QHttpHeader.

QHttpHeader provides the HTTP header fields. A HTTP header field consists of a name followed by a colon, a single space, and the field value. (See RFC 1945.) Field names are case-insensitive. A typical header field looks like this:

    content-type: text/html

In the API the header field name is called the "key" and the content is called the "value". You can get and set a header field's value by using its key with value() and setValue(), e.g.

    header.setValue( "content-type", "text/html" );
    QString contentType = header.value( "content-type" );

Some fields are so common that getters and setters are provided for them as a convenient alternative to using value() and setValue(), e.g. contentLength() and contentType(), setContentLength() and setContentType().

Each header key has a single value associated with it. If you set the value for a key which already exists the previous value will be discarded.

Ver también:
QHttpRequestHeader QHttpResponseHeader

Documentación del constructor y destructor

QHttpHeader::QHttpHeader ( )

Constructs an empty HTTP header.

QHttpHeader::QHttpHeader ( const QHttpHeader header)

Constructs a copy of header.

QHttpHeader::QHttpHeader ( const QString str)

Constructs a HTTP header for str.

This constructor parses the string str for header fields and adds this information. The str should consist of one or more "\r\n" delimited lines; each of these lines should have the format key, colon, space, value.

QHttpHeader::~QHttpHeader ( ) [virtual]

Destructor.

QHttpHeader::QHttpHeader ( )
QHttpHeader::QHttpHeader ( const QHttpHeader header)
QHttpHeader::QHttpHeader ( const QString str)
virtual QHttpHeader::~QHttpHeader ( ) [virtual]

Documentación de las funciones miembro

uint QHttpHeader::contentLength ( ) const

Returns the value of the special HTTP header field content-length.

Ver también:
setContentLength() hasContentLength()
uint QHttpHeader::contentLength ( ) const
QString QHttpHeader::contentType ( ) const

Returns the value of the special HTTP header field content-type.

Ver también:
setContentType() hasContentType()
QString QHttpHeader::contentType ( ) const
bool QHttpHeader::hasContentLength ( ) const

Returns TRUE if the header has an entry for the special HTTP header field content-length; otherwise returns FALSE.

Ver también:
contentLength() setContentLength()
bool QHttpHeader::hasContentLength ( ) const
bool QHttpHeader::hasContentType ( ) const

Returns TRUE if the header has an entry for the the special HTTP header field content-type; otherwise returns FALSE.

Ver también:
contentType() setContentType()
bool QHttpHeader::hasContentType ( ) const
bool QHttpHeader::hasKey ( const QString key) const

Returns TRUE if the HTTP header has an entry with the given key; otherwise returns FALSE.

Ver también:
value() setValue() keys()
bool QHttpHeader::hasKey ( const QString key) const
bool QHttpHeader::isValid ( ) const
bool QHttpHeader::isValid ( void  ) const

Returns TRUE if the HTTP header is valid; otherwise returns FALSE.

A QHttpHeader is invalid if it was created by parsing a malformed string.

QStringList QHttpHeader::keys ( ) const
QStringList QHttpHeader::keys ( ) const

Returns a list of the keys in the HTTP header.

Ver también:
hasKey()
virtual int QHttpHeader::majorVersion ( ) const [pure virtual]
int QHttpHeader::majorVersion ( ) const [pure virtual]

Returns the major protocol-version of the HTTP header.

Implementado en QHttpResponseHeader, QHttpRequestHeader, QHttpResponseHeader y QHttpRequestHeader.

int QHttpHeader::minorVersion ( ) const [pure virtual]

Returns the minor protocol-version of the HTTP header.

Implementado en QHttpResponseHeader, QHttpRequestHeader, QHttpResponseHeader y QHttpRequestHeader.

virtual int QHttpHeader::minorVersion ( ) const [pure virtual]
QHttpHeader & QHttpHeader::operator= ( const QHttpHeader h)

Assigns h and returns a reference to this http header.

QHttpHeader& QHttpHeader::operator= ( const QHttpHeader h)
bool QHttpHeader::parse ( const QString str) [protected]
bool QHttpHeader::parse ( const QString str) [protected]
virtual bool QHttpHeader::parseLine ( const QString line,
int  number 
) [protected, virtual]
bool QHttpHeader::parseLine ( const QString line,
int  number 
) [protected, virtual]
void QHttpHeader::removeValue ( const QString key)

Removes the entry with the key key from the HTTP header.

Ver también:
value() setValue()
void QHttpHeader::removeValue ( const QString key)
void QHttpHeader::setContentLength ( int  len)
void QHttpHeader::setContentLength ( int  len)

Sets the value of the special HTTP header field content-length to len.

Ver también:
contentLength() hasContentLength()
void QHttpHeader::setContentType ( const QString type)

Sets the value of the special HTTP header field content-type to type.

Ver también:
contentType() hasContentType()
void QHttpHeader::setContentType ( const QString type)
void QHttpHeader::setValid ( bool  ) [protected]
void QHttpHeader::setValid ( bool  v) [protected]
void QHttpHeader::setValue ( const QString key,
const QString value 
)
void QHttpHeader::setValue ( const QString key,
const QString value 
)

Sets the value of the entry with the key to value.

If no entry with key exists, a new entry with the given key and value is created. If an entry with the key already exists, its value is discarded and replaced with the given value.

Ver también:
value() hasKey() removeValue()
QString QHttpHeader::toString ( ) const [virtual]

Returns a string representation of the HTTP header.

The string is suitable for use by the constructor that takes a QString. It consists of lines with the format: key, colon, space, value, "\r\n".

Reimplementado en QHttpResponseHeader, QHttpRequestHeader, QHttpResponseHeader y QHttpRequestHeader.

virtual QString QHttpHeader::toString ( ) const [virtual]
QString QHttpHeader::value ( const QString key) const

Returns the value for the entry with the given key. If no entry has this key, an empty string is returned.

Ver también:
setValue() removeValue() hasKey() keys()
QString QHttpHeader::value ( const QString key) const

La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'