22 #ifndef BACKENDS_NETWORKING_HTTP_NETWORKREADSTREAM_H 23 #define BACKENDS_NETWORKING_HTTP_NETWORKREADSTREAM_H 25 #include "common/array.h" 26 #include "common/hash-str.h" 27 #include "common/hashmap.h" 28 #include "common/memstream.h" 29 #include "common/path.h" 30 #include "common/str.h" 31 #include "common/stream.h" 40 long _keepAliveIdle, _keepAliveInterval;
44 : _eos(
false), _keepAlive(keepAlive),
45 _keepAliveIdle(keepAliveIdle), _keepAliveInterval(keepAliveInterval) {
53 bool uploading =
false,
bool usingPatch =
false,
54 bool keepAlive =
false,
long keepAliveIdle = 120,
long keepAliveInterval = 60);
59 bool keepAlive =
false,
long keepAliveIdle = 120,
long keepAliveInterval = 60);
62 static NetworkReadStream *
make(
const char *url, RequestHeaders *headersList,
const byte *buffer, uint32 bufferSize,
63 bool uploading =
false,
bool usingPatch =
false,
bool post =
true,
64 bool keepAlive =
false,
long keepAliveIdle = 120,
long keepAliveInterval = 60);
67 virtual bool reuse(
const char *url, RequestHeaders *headersList,
const Common::String &postFields,
bool uploading =
false,
bool usingPatch =
false) = 0;
70 const char *url, RequestHeaders *headersList,
74 virtual bool reuse(
const char *url, RequestHeaders *headersList,
const byte *buffer, uint32 bufferSize,
bool uploading =
false,
bool usingPatch =
false,
bool post =
true) = 0;
85 bool eos()
const override {
return _eos; }
99 uint32
read(
void *dataPtr, uint32 dataSize)
override = 0;
128 bool keepAlive()
const {
return _keepAlive; }
130 virtual bool hasError()
const = 0;
131 virtual const char *getError()
const = 0;
virtual Common::HashMap< Common::String, Common::String > responseHeadersMap() const =0
virtual bool reuse(const char *url, RequestHeaders *headersList, const Common::String &postFields, bool uploading=false, bool usingPatch=false)=0
Definition: scummvmcloud.h:32
bool eos() const override
Definition: networkreadstream.h:85
static NetworkReadStream * make(const char *url, RequestHeaders *headersList, const Common::String &postFields, bool uploading=false, bool usingPatch=false, bool keepAlive=false, long keepAliveIdle=120, long keepAliveInterval=60)
virtual long httpResponseCode() const =0
uint32 read(void *dataPtr, uint32 dataSize) override=0
virtual double getProgress() const =0
Definition: networkreadstream.h:37
virtual Common::String currentLocation() const =0