1 #ifndef BALL_SYSTEM_SIMPLEDOWNLOADER_H
2 #define BALL_SYSTEM_SIMPLEDOWNLOADER_H
4 #ifndef BALL_DATATYPE_STRING_H
8 #include <QtCore/QThread>
9 #include <QtCore/QFile>
10 #include <QtNetwork/QFtp>
12 #include <QtNetwork/QNetworkReply>
18 namespace SimpleDownloaderHelper
64 int downloadToBuffer(std::vector<char>& buffer);
72 int downloadToFile(
const String& path);
82 int uploadStringToBuffer(
const String& data, std::vector<char>& response);
92 int uploadStringToFile(
const String& data,
const String& response);
102 int uploadFileToBuffer(
const String& path, std::vector<char>& response);
112 int uploadFileToFile(
const String& path,
const String& response);
120 void setTimeout(
unsigned int timeout);
127 void setURL(
const String& url);
134 void setURL(
const QUrl& url);
141 const QUrl& getURL()
const;
145 int qftpDownloadHack_(QIODevice* iodev);
148 unsigned int timeout_;
151 namespace SimpleDownloaderHelper
162 virtual QNetworkReply*
getReply_(QNetworkAccessManager* man) = 0;
180 virtual QNetworkReply*
getReply_(QNetworkAccessManager* man);
192 virtual QNetworkReply*
getReply_(QNetworkAccessManager* man);
207 void error(QNetworkReply::NetworkError
error);
208 #ifndef QT_NO_OPENSSL
209 void sslErrors(
const QList<QSslError>& errors);
281 void done(
bool error);
290 #endif //BALL_SYSTEM_SIMPLEDOWNLOADER_H
QFtpHackThread(const QUrl &url, QIODevice *iodev, SimpleDownloader *parent)
DLThread(const QUrl &url, QByteArray *result, SimpleDownloader *parent)
BasicHelper(HelperThread *caller, QNetworkReply *reply)
virtual QNetworkReply * getReply_(QNetworkAccessManager *man)=0
virtual QNetworkReply * getReply_(QNetworkAccessManager *man)
DLArrayHelper(HelperThread *caller, QNetworkReply *reply, QByteArray *result)
virtual void finished()=0
void sslErrors(const QList< QSslError > &errors)
UPThread(const QUrl &url, const QByteArray *data, QByteArray *result, SimpleDownloader *parent)
void error(QNetworkReply::NetworkError error)
DLHelper(HelperThread *caller, QNetworkReply *reply, const String &path)
SimpleDownloader * parent_
HelperThread(const QUrl &url, QByteArray *result, SimpleDownloader *parent)
virtual QNetworkReply * getReply_(QNetworkAccessManager *man)
QFtpHackHelper(QFtpHackThread *th)