NuriaProject Framework
0.1
The NuriaProject Framework
|
Reader for HTTP multi-part formatted data. More...
#include <httpmultipartreader.hpp>
Public Member Functions | |
HttpMultiPartReader (QIODevice *device, const QByteArray &boundary, QObject *parent=nullptr) | |
~HttpMultiPartReader () | |
qint64 | fieldBytesTransferred (const QString &field) const override |
qint64 | fieldLength (const QString &field) const override |
QString | fieldMimeType (const QString &field) const override |
QStringList | fieldNames () const override |
QIODevice * | fieldStream (const QString &field) override |
bool | hasFailed () const override |
bool | hasField (const QString &field) const override |
bool | isComplete () const override |
bool | isFieldComplete (const QString &field) const override |
![]() | |
HttpPostBodyReader (QObject *parent=0) | |
~HttpPostBodyReader () | |
virtual QByteArray | fieldValue (const QString &field) |
Additional Inherited Members | |
![]() | |
void | completed (bool success) |
void | fieldCompleted (const QString &fieldName) |
void | fieldFound (const QString &fieldName) |
Reader for HTTP multi-part formatted data.
HTTP User-agents use specific formats to transfer form-data to the server. One of these formats is 'multi-part'.
For the user of this class this means, that:
-1
as long the transfer is in process.Nuria::HttpMultiPartReader::HttpMultiPartReader | ( | QIODevice * | device, |
const QByteArray & | boundary, | ||
QObject * | parent = nullptr |
||
) |
Creates a multi-part reader which acts upon device.
Nuria::HttpMultiPartReader::~HttpMultiPartReader | ( | ) |
Destructor.
|
overridevirtual |
Returns the amount of bytes transferred of field.
Implements Nuria::HttpPostBodyReader.
|
overridevirtual |
Returns the total length of field. If field is unknown or the length is unknown, returns -1
.
Implements Nuria::HttpPostBodyReader.
|
overridevirtual |
Returns the MIME-Type of field. If field does not exist or the MIME-Type is unknown, returns an empty string.
Implements Nuria::HttpPostBodyReader.
|
overridevirtual |
Returns the list of known field names.
Implements Nuria::HttpPostBodyReader.
|
overridevirtual |
Returns a QIODevice which reads contents from field in a streaming fashion. If field has not been found, nullptr
is returned instead.
If field is a known field but is currently been transferred, then the returned stream will operate upon the already received data and new received data is put into it.
Implements Nuria::HttpPostBodyReader.
|
overridevirtual |
Returns true
if parsing has failed.
Implements Nuria::HttpPostBodyReader.
|
overridevirtual |
Returns true
if field exists. The default implementation looks for field in the result of fieldNames().
Reimplemented from Nuria::HttpPostBodyReader.
|
overridevirtual |
Returns true
if the body has been read completely. Also returns true
if parsing has failed.
Implements Nuria::HttpPostBodyReader.
|
overridevirtual |
Returns true
if transfer of field is complete. If it is not, or if field does not exist, false
is returned.
The default implementation compares the result of fieldLength() to the one of fieldBytesTransferred().
Reimplemented from Nuria::HttpPostBodyReader.