QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
QgsNetworkReplyParser Class Reference

Multipart QNetworkReply parser. More...

#include <qgsnetworkreplyparser.h>

Public Types

typedef QMap< QByteArray,
QByteArray > 
RawHeaderMap

Public Member Functions

 QgsNetworkReplyParser (QNetworkReply *reply)
 Constructor.
QList< QByteArray > bodies () const
 Get bodies.
QByteArray body (int part) const
 Get part part body.
QString error () const
 Parsing error.
QList< RawHeaderMapheaders () const
 Get headers.
bool isValid () const
 Indicates if successfully parsed.
int parts () const
 Get number of parts.
QByteArray rawHeader (int part, const QByteArray &headerName) const
 Get part header.

Static Public Member Functions

static bool isMultipart (QNetworkReply *reply)
 Test if reply is multipart.

Detailed Description

Multipart QNetworkReply parser.

It seams that Qt does not have currently support for multipart reply and it is not even possible to create QNetworkReply from raw data so we need a class for multipart QNetworkReply parsing.

Definition at line 33 of file qgsnetworkreplyparser.h.

Member Typedef Documentation

typedef QMap<QByteArray, QByteArray> QgsNetworkReplyParser::RawHeaderMap

Definition at line 38 of file qgsnetworkreplyparser.h.

Constructor & Destructor Documentation

QgsNetworkReplyParser::QgsNetworkReplyParser ( QNetworkReply *  reply)

Constructor.

Parameters
reply

Definition at line 28 of file qgsnetworkreplyparser.cpp.

Member Function Documentation

QList<QByteArray> QgsNetworkReplyParser::bodies ( ) const
inline

Get bodies.

Definition at line 67 of file qgsnetworkreplyparser.h.

QByteArray QgsNetworkReplyParser::body ( int  part) const
inline

Get part part body.

Parameters
partpart index
Returns
part body

Definition at line 64 of file qgsnetworkreplyparser.h.

QString QgsNetworkReplyParser::error ( ) const
inline

Parsing error.

Definition at line 70 of file qgsnetworkreplyparser.h.

QList< RawHeaderMap > QgsNetworkReplyParser::headers ( ) const
inline

Get headers.

Definition at line 59 of file qgsnetworkreplyparser.h.

bool QgsNetworkReplyParser::isMultipart ( QNetworkReply *  reply)
static

Test if reply is multipart.

Returns
true if reply is multipart

Definition at line 138 of file qgsnetworkreplyparser.cpp.

bool QgsNetworkReplyParser::isValid ( ) const
inline

Indicates if successfully parsed.

Returns
true if successfully parsed

Definition at line 46 of file qgsnetworkreplyparser.h.

int QgsNetworkReplyParser::parts ( ) const
inline

Get number of parts.

Returns
number of parts

Definition at line 50 of file qgsnetworkreplyparser.h.

QByteArray QgsNetworkReplyParser::rawHeader ( int  part,
const QByteArray &  headerName 
) const
inline

Get part header.

Parameters
partpart index
headerNameheader name
Returns
raw header

Definition at line 56 of file qgsnetworkreplyparser.h.


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