Home · Modules · Classes · Namespaces · Functions

QxtWebContent Class Reference
[QxtWeb module]

The QxtWebContent class provides and I/O device for data sent by the web browser More...

    #include <QxtWebContent>

Inherits QIODevice.

Public Functions

Public Slots

Static Public Members

Additional Inherited Members


Detailed Description

The QxtWebContent class provides and I/O device for data sent by the web browser

QxtWebContent is a read-only QIODevice subclass that encapsulates data sent from the web browser, for instance in a POST or PUT request.

In order to avoid delays while reading content sent from the client, and to insulate multiple pipelined requests on the same connection from each other, QxtWeb uses QxtWebContent as an abstraction for streaming data.

See also QxtAbstractWebService.


Member Function Documentation

QxtWebContent::QxtWebContent ( int contentLength, const QByteArray & start, QIODevice * device )

Constructs a QxtWebContent object.

The content provided by this constructor is the data contained in start, followed by enough data read from the provided device to fill the desired contentLength.

The QxtWebContent object is parented to the device.

QxtWebContent::QxtWebContent ( int contentLength, QIODevice * device )

Constructs a QxtWebContent object.

The content provided by this constructor is the first contentLength bytes read from the provided device.

The QxtWebContent object is parented to the device.

QxtWebContent::QxtWebContent ( const QByteArray & content, QObject * parent = 0 )

Constructs a QxtWebContent object with the specified parent.

The content provided by this constructor is exactly the data contained in content.

void QxtWebContent::ignoreRemainingContent ()   [slot]

Discards any data not yet read.

After invoking this function, any further data received from the browser is silently discarded.

QHash<QString, QString> QxtWebContent::parseUrlEncodedQuery ( const QString & data )   [static]

Extracts the key/value pairs from application/x-www-form-urlencoded data, such as the query string from the URL or the form data from a POST request.

qint64 QxtWebContent::unreadBytes () const

Returns the number of bytes of content that have not yet been read.

Note that not all of the remaining content may be immediately available for reading. This function returns the content length, minus the number of bytes that have already been read.

void QxtWebContent::waitForAllContent ()

Blocks until all of the streaming data has been read from the browser.

Note that this function will block events for the thread on which it is called. If the main thread is blocked, QxtWeb will be unable to process additional requests until the content has been received.


Copyright © 2007-2010 Qxt Foundation
Qxt 0.6.1