mirror-chatterino2/src/common/NetworkData.hpp

41 lines
709 B
C++
Raw Normal View History

#pragma once
#include "common/NetworkCommon.hpp"
#include <QNetworkRequest>
#include <functional>
class QNetworkReply;
namespace chatterino {
class NetworkResult;
struct NetworkData {
NetworkData();
~NetworkData();
QNetworkRequest request_;
const QObject *caller_ = nullptr;
bool useQuickLoadCache_{};
2018-08-10 18:56:17 +02:00
bool executeConcurrently{};
NetworkReplyCreatedCallback onReplyCreated_;
NetworkErrorCallback onError_;
NetworkSuccessCallback onSuccess_;
NetworkRequestType requestType_ = NetworkRequestType::Get;
QByteArray payload_;
QString getHash();
void writeToCache(const QByteArray &bytes);
private:
QString hash_;
};
} // namespace chatterino