|
NuriaProject Framework
0.1
The NuriaProject Framework
|
Reader for HTTP url-encoded formatted data. More...
#include <httpurlencodedreader.hpp>
Public Member Functions | |
| HttpUrlEncodedReader (QIODevice *device, const QByteArray &charset, QObject *parent=nullptr) | |
| ~HttpUrlEncodedReader () | |
| qint64 | fieldBytesTransferred (const QString &field) const override |
| qint64 | fieldLength (const QString &field) const override |
| QString | fieldMimeType (const QString &) const override |
| QStringList | fieldNames () const override |
| QIODevice * | fieldStream (const QString &field) override |
| QByteArray | fieldValue (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 |
Public Member Functions inherited from Nuria::HttpPostBodyReader | |
| HttpPostBodyReader (QObject *parent=0) | |
| ~HttpPostBodyReader () | |
Additional Inherited Members | |
Signals inherited from Nuria::HttpPostBodyReader | |
| void | completed (bool success) |
| void | fieldCompleted (const QString &fieldName) |
| void | fieldFound (const QString &fieldName) |
Reader for HTTP url-encoded formatted data.
Further, this class does not have support for streaming fields, as URL encoded data is generally short.
For the user of this class this means, that:
-1 as long the transfer is in process.| Nuria::HttpUrlEncodedReader::HttpUrlEncodedReader | ( | QIODevice * | device, |
| const QByteArray & | charset, | ||
| QObject * | parent = nullptr |
||
| ) |
Creates a url-encoded reader which acts upon device.
| Nuria::HttpUrlEncodedReader::~HttpUrlEncodedReader | ( | ) |
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 the value of field. If the field has not been received completely yet or there's no field, then a empty QByteArray is returned.
The default implementation uses infoStream() to obtain the device and read all of its content, if isFieldComplete() returns true.
Reimplemented from 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.
1.8.9.1