|
| virtual bool | reuse (const char *url, RequestHeaders *headersList, const Common::String &postFields, bool uploading=false, bool usingPatch=false)=0 |
| |
| virtual bool | reuse (const char *url, RequestHeaders *headersList, const Common::HashMap< Common::String, Common::String > &formFields, const Common::HashMap< Common::String, Common::Path > &formFiles)=0 |
| |
| virtual bool | reuse (const char *url, RequestHeaders *headersList, const byte *buffer, uint32 bufferSize, bool uploading=false, bool usingPatch=false, bool post=true)=0 |
| |
| bool | eos () const override |
| |
| uint32 | read (void *dataPtr, uint32 dataSize) override |
| |
| virtual long | httpResponseCode () const =0 |
| |
| virtual Common::String | currentLocation () const =0 |
| |
| virtual Common::HashMap< Common::String, Common::String > | responseHeadersMap () const =0 |
| |
| double | getProgress () const |
| |
| void | setProgress (uint64 downloaded, uint64 total) |
| |
|
bool | keepAlive () const |
| |
|
virtual bool | hasError () const =0 |
| |
|
virtual const char * | getError () const =0 |
| |
| 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) |
| |
| virtual bool | err () const |
| |
| virtual void | clearErr () |
| |
|
| 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) |
| |
| static NetworkReadStream * | make (const char *url, RequestHeaders *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) |
| |
| static NetworkReadStream * | make (const char *url, RequestHeaders *headersList, const byte *buffer, uint32 bufferSize, bool uploading=false, bool usingPatch=false, bool post=true, bool keepAlive=false, long keepAliveIdle=120, long keepAliveInterval=60) |
| |
|
| uint32 | fillWithSendingContents (char *bufferToFill, uint32 maxSize) |
| |
| uint32 | addResponseHeaders (char *buffer, uint32 bufferSize) |
| |
|
| NetworkReadStream (bool keepAlive, long keepAliveIdle, long keepAliveInterval) |
| |
|
|
Common::MemoryReadWriteStream | _backingStream |
| |
|
bool | _keepAlive |
| |
|
long | _keepAliveIdle |
| |
|
long | _keepAliveInterval |
| |
|
bool | _eos |
| |
|
bool | _requestComplete |
| |
|
const byte * | _sendingContentsBuffer |
| |
|
uint32 | _sendingContentsSize |
| |
|
uint32 | _sendingContentsPos |
| |
|
Common::String | _responseHeaders |
| |
|
uint64 | _progressDownloaded |
| |
|
uint64 | _progressTotal |
| |
◆ fillWithSendingContents()
| uint32 Networking::NetworkReadStream::fillWithSendingContents |
( |
char * |
bufferToFill, |
|
|
uint32 |
maxSize |
|
) |
| |
|
protected |
Fills the passed buffer with _sendingContentsBuffer contents. It works similarly to read(), expect it's not for reading Stream's contents, but for sending our own data to the server.
- Returns
- how many bytes were actually read (filled in)
◆ addResponseHeaders()
| uint32 Networking::NetworkReadStream::addResponseHeaders |
( |
char * |
buffer, |
|
|
uint32 |
bufferSize |
|
) |
| |
|
protected |
Remembers headers returned to CURL in server's response.
- Returns
- how many bytes were actually read
◆ make() [1/3]
| static NetworkReadStream* Networking::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 |
|
) |
| |
|
static |
Send <postFields>, using POST by default.
◆ make() [2/3]
Send <formFields>, <formFiles>, using POST multipart/form.
◆ make() [3/3]
| static NetworkReadStream* Networking::NetworkReadStream::make |
( |
const char * |
url, |
|
|
RequestHeaders * |
headersList, |
|
|
const byte * |
buffer, |
|
|
uint32 |
bufferSize, |
|
|
bool |
uploading = false, |
|
|
bool |
usingPatch = false, |
|
|
bool |
post = true, |
|
|
bool |
keepAlive = false, |
|
|
long |
keepAliveIdle = 120, |
|
|
long |
keepAliveInterval = 60 |
|
) |
| |
|
static |
Send <buffer>, using POST by default.
◆ reuse() [1/3]
| virtual bool Networking::NetworkReadStream::reuse |
( |
const char * |
url, |
|
|
RequestHeaders * |
headersList, |
|
|
const Common::String & |
postFields, |
|
|
bool |
uploading = false, |
|
|
bool |
usingPatch = false |
|
) |
| |
|
pure virtual |
◆ reuse() [2/3]
◆ reuse() [3/3]
| virtual bool Networking::NetworkReadStream::reuse |
( |
const char * |
url, |
|
|
RequestHeaders * |
headersList, |
|
|
const byte * |
buffer, |
|
|
uint32 |
bufferSize, |
|
|
bool |
uploading = false, |
|
|
bool |
usingPatch = false, |
|
|
bool |
post = true |
|
) |
| |
|
pure virtual |
◆ eos()
| bool Networking::NetworkReadStream::eos |
( |
| ) |
const |
|
inlineoverridevirtual |
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.
- Note
- The semantics of any implementation of this method are supposed to match those of ISO C feof(). In particular, in a stream with N bytes, reading exactly N bytes from the start should not set eos; only reading beyond the available data should set it.
Implements Common::ReadStream.
◆ read()
| uint32 Networking::NetworkReadStream::read |
( |
void * |
dataPtr, |
|
|
uint32 |
dataSize |
|
) |
| |
|
overridevirtual |
Read data from the stream. Subclasses must implement this method; all other read methods are implemented using it.
- Note
- The semantics of any implementation of this method are supposed to match those of ISO C fread(), in particular where it concerns setting error and end of file/stream flags.
- Parameters
-
| dataPtr | pointer to a buffer into which the data is read |
| dataSize | number of bytes to be read |
- Returns
- the number of bytes which were actually read.
Implements Common::ReadStream.
◆ httpResponseCode()
| virtual long Networking::NetworkReadStream::httpResponseCode |
( |
| ) |
const |
|
pure virtual |
◆ currentLocation()
| virtual Common::String Networking::NetworkReadStream::currentLocation |
( |
| ) |
const |
|
pure virtual |
◆ responseHeadersMap()
◆ getProgress()
| double Networking::NetworkReadStream::getProgress |
( |
| ) |
const |
Returns a number in range [0, 1], where 1 is "complete".
◆ setProgress()
| void Networking::NetworkReadStream::setProgress |
( |
uint64 |
downloaded, |
|
|
uint64 |
total |
|
) |
| |
Used in curl progress callback to pass current downloaded/total values.
The documentation for this class was generated from the following file: