![]() |
LeechCraft
0.6.70-13729-g7046a9d2a7
Modular cross-platform feature rich live environment.
|
A network reply with customizable content and reply headers. More...
#include "customnetworkreply.h"
Inheritance diagram for LC::Util::CustomNetworkReply:
Collaboration diagram for LC::Util::CustomNetworkReply:Public Member Functions | |
| CustomNetworkReply (const QUrl &url, QObject *parent=0) | |
| Creates the reply with the given url and parent. More... | |
| void | SetContentType (const QByteArray &type) |
| Sets the content type of this reply. More... | |
| void | SetContent (const QString &string) |
| Sets content of this reply to the given string. More... | |
| void | SetContent (const QByteArray &data) |
| Sets content of this reply to the given data. More... | |
| void | abort () override |
| Reimplemented from QNetworkReply::abort(). More... | |
| qint64 | bytesAvailable () const override |
| Reimplemented from QNetworkReply::bytesAvailable(). More... | |
| bool | isSequential () const override |
| Reimplemented from QNetworkReply::isSequential(). More... | |
Protected Member Functions | |
| qint64 | readData (char *, qint64) override |
A network reply with customizable content and reply headers.
This class provides a custom network reply with settable content and headers. It can be used, for example, in a plugin that renders local filesystem to QNetworkAccessManager-enabled plugins, or that just needs to provide a network reply with a predefined or runtime-generated string.
Definition at line 49 of file customnetworkreply.h.
| LC::Util::CustomNetworkReply::CustomNetworkReply | ( | const QUrl & | url, |
| QObject * | parent = 0 |
||
| ) |
Creates the reply with the given url and parent.
Sets the URL of this reply to be url. This URL will be returned by QNetworkReply::url()
| [in] | url | The URL this custom reply corresponds to. |
| [in] | parent | The parent object of this object. |
Definition at line 38 of file customnetworkreply.cpp.
|
override |
Reimplemented from QNetworkReply::abort().
This function does nothing.
Definition at line 71 of file customnetworkreply.cpp.
|
override |
Reimplemented from QNetworkReply::bytesAvailable().
This function returns the number of bytes left unread.
Definition at line 75 of file customnetworkreply.cpp.
Referenced by readData().
Here is the caller graph for this function:
|
override |
Reimplemented from QNetworkReply::isSequential().
This function always returns true.
Definition at line 80 of file customnetworkreply.cpp.
|
overrideprotected |
Definition at line 85 of file customnetworkreply.cpp.
References bytesAvailable(), and LC::Util::oral::sph::min.
Here is the call graph for this function:| void LC::Util::CustomNetworkReply::SetContent | ( | const QString & | string | ) |
Sets content of this reply to the given string.
This convenience function is equivalent to
| [in] | string | The string to set. |
Definition at line 49 of file customnetworkreply.cpp.
| void LC::Util::CustomNetworkReply::SetContent | ( | const QByteArray & | data | ) |
Sets content of this reply to the given data.
This function sets the content of this reply to the given data, updates the Content-Length header and schedules emission of the readyRead() and finished() signals next time control reaches the event loop.
| [in] | data | The data this network reply should contain. |
Definition at line 54 of file customnetworkreply.cpp.
| void LC::Util::CustomNetworkReply::SetContentType | ( | const QByteArray & | type | ) |
Sets the content type of this reply.
This function sets the Content-Type header to type.
It is equivalent to
Definition at line 44 of file customnetworkreply.cpp.