Public Member Functions | |
NetworkReadStream (const char *url, curl_slist *headersList, const Common::String &postFields, bool uploading=false, bool usingPatch=false, bool keepAlive=false, long keepAliveIdle=120, long keepAliveInterval=60) | |
NetworkReadStream (const char *url, curl_slist *headersList, const Common::HashMap< Common::String, Common::String > &formFields, const Common::HashMap< Common::String, Common::Path > &formFiles, bool keepAlive=false, long keepAliveIdle=120, long keepAliveInterval=60) | |
NetworkReadStream (const char *url, curl_slist *headersList, const byte *buffer, uint32 bufferSize, bool uploading=false, bool usingPatch=false, bool post=true, bool keepAlive=false, long keepAliveIdle=120, long keepAliveInterval=60) | |
bool | reuse (const char *url, curl_slist *headersList, const Common::String &postFields, bool uploading=false, bool usingPatch=false) |
bool | reuse (const char *url, curl_slist *headersList, const Common::HashMap< Common::String, Common::String > &formFields, const Common::HashMap< Common::String, Common::Path > &formFiles) |
bool | reuse (const char *url, curl_slist *headersList, const byte *buffer, uint32 bufferSize, bool uploading=false, bool usingPatch=false, bool post=true) |
bool | eos () const override |
uint32 | read (void *dataPtr, uint32 dataSize) override |
void | finished (uint32 errorCode) |
long | httpResponseCode () const |
Common::String | currentLocation () const |
Common::String | responseHeaders () const |
Common::HashMap< Common::String, Common::String > | responseHeadersMap () const |
double | getProgress () const |
void | setProgress (uint64 downloaded, uint64 total) |
bool | keepAlive () const |
bool | hasError () const |
uint32 | getErrorCode () const |
const char * | getError () const |
Public Member Functions inherited from Common::ReadStream | |
byte | readByte () |
FORCEINLINE int8 | readSByte () |
uint16 | readUint16LE () |
uint32 | readUint32LE () |
uint64 | readUint64LE () |
uint16 | readUint16BE () |
uint32 | readUint32BE () |
uint64 | readUint64BE () |
FORCEINLINE int16 | readSint16LE () |
FORCEINLINE int32 | readSint32LE () |
FORCEINLINE int64 | readSint64LE () |
FORCEINLINE int16 | readSint16BE () |
FORCEINLINE int32 | readSint32BE () |
FORCEINLINE int64 | readSint64BE () |
FORCEINLINE float | readFloatLE () |
FORCEINLINE float | readFloatBE () |
FORCEINLINE double | readDoubleLE () |
FORCEINLINE double | readDoubleBE () |
template<class TDataFormat , class... T> | |
bool | readMultiple (const TDataFormat &dataFormat, T &...values) |
template<class... T> | |
bool | readMultipleEndian (bool isLittle, T &...values) |
template<class... T> | |
bool | readMultipleLE (T &...values) |
template<class... T> | |
bool | readMultipleBE (T &...values) |
SeekableReadStream * | readStream (uint32 dataSize) |
String | readString (char terminator=0, size_t len=String::npos) |
Common::String | readPascalString (bool transformCR=true) |
Public Member Functions inherited from Common::Stream | |
virtual bool | err () const |
virtual void | clearErr () |
Networking::NetworkReadStream::NetworkReadStream | ( | const char * | url, |
curl_slist * | headersList, | ||
const Common::String & | postFields, | ||
bool | uploading = false , |
||
bool | usingPatch = false , |
||
bool | keepAlive = false , |
||
long | keepAliveIdle = 120 , |
||
long | keepAliveInterval = 60 |
||
) |
Send <postFields>, using POST by default.
Networking::NetworkReadStream::NetworkReadStream | ( | const char * | url, |
curl_slist * | headersList, | ||
const Common::HashMap< Common::String, Common::String > & | formFields, | ||
const Common::HashMap< Common::String, Common::Path > & | formFiles, | ||
bool | keepAlive = false , |
||
long | keepAliveIdle = 120 , |
||
long | keepAliveInterval = 60 |
||
) |
Send <formFields>, <formFiles>, using POST multipart/form.
Networking::NetworkReadStream::NetworkReadStream | ( | const char * | url, |
curl_slist * | headersList, | ||
const byte * | buffer, | ||
uint32 | bufferSize, | ||
bool | uploading = false , |
||
bool | usingPatch = false , |
||
bool | post = true , |
||
bool | keepAlive = false , |
||
long | keepAliveIdle = 120 , |
||
long | keepAliveInterval = 60 |
||
) |
Send <buffer>, using POST by default.
bool Networking::NetworkReadStream::reuse | ( | const char * | url, |
curl_slist * | headersList, | ||
const Common::String & | postFields, | ||
bool | uploading = false , |
||
bool | usingPatch = false |
||
) |
Send <postFields>, using POST by default.
bool Networking::NetworkReadStream::reuse | ( | const char * | url, |
curl_slist * | headersList, | ||
const Common::HashMap< Common::String, Common::String > & | formFields, | ||
const Common::HashMap< Common::String, Common::Path > & | formFiles | ||
) |
Send <formFields>, <formFiles>, using POST multipart/form.
bool Networking::NetworkReadStream::reuse | ( | const char * | url, |
curl_slist * | headersList, | ||
const byte * | buffer, | ||
uint32 | bufferSize, | ||
bool | uploading = false , |
||
bool | usingPatch = false , |
||
bool | post = true |
||
) |
Send <buffer>, using POST by default.
|
overridevirtual |
Returns true if a read failed because the stream end has been reached. This flag is cleared by clearErr(). For a SeekableReadStream, it is also cleared by a successful seek.
Implements Common::ReadStream.
|
overridevirtual |
Read data from the stream. Subclasses must implement this method; all other read methods are implemented using it.
dataPtr | pointer to a buffer into which the data is read |
dataSize | number of bytes to be read |
Implements Common::ReadStream.
void Networking::NetworkReadStream::finished | ( | uint32 | errorCode | ) |
This method is called by ConnectionManager to indicate that transfer is finished.
long Networking::NetworkReadStream::httpResponseCode | ( | ) | const |
Returns HTTP response code from inner CURL handle. It returns -1 to indicate there is no inner handle.
Common::String Networking::NetworkReadStream::currentLocation | ( | ) | const |
Return current location URL from inner CURL handle. "" is returned to indicate there is no inner handle.
Common::String Networking::NetworkReadStream::responseHeaders | ( | ) | const |
Return response headers.
Common::HashMap<Common::String, Common::String> Networking::NetworkReadStream::responseHeadersMap | ( | ) | const |
Return response headers as HashMap. All header names in it are lowercase.
double Networking::NetworkReadStream::getProgress | ( | ) | const |
Returns a number in range [0, 1], where 1 is "complete".
void Networking::NetworkReadStream::setProgress | ( | uint64 | downloaded, |
uint64 | total | ||
) |
Used in curl progress callback to pass current downloaded/total values.