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);
211 virtual void finished() = 0;
281 void done(
bool error);
290 #endif //BALL_SYSTEM_SIMPLEDOWNLOADER_H
SimpleDownloader * parent_
-*- Mode: C++; tab-width: 2; -*-