ScummVM API documentation
Networking::NetworkReadStreamCurl Class Reference
Inheritance diagram for Networking::NetworkReadStreamCurl:
Networking::NetworkReadStream Common::ReadStream Common::Stream

Public Member Functions

 NetworkReadStreamCurl (const char *url, RequestHeaders *headersList, const Common::String &postFields, bool uploading, bool usingPatch, bool keepAlive, long keepAliveIdle, long keepAliveInterval)
 
 NetworkReadStreamCurl (const char *url, RequestHeaders *headersList, const Common::HashMap< Common::String, Common::String > &formFields, const Common::HashMap< Common::String, Common::Path > &formFiles, bool keepAlive, long keepAliveIdle, long keepAliveInterval)
 
 NetworkReadStreamCurl (const char *url, RequestHeaders *headersList, const byte *buffer, uint32 bufferSize, bool uploading, bool usingPatch, bool post, bool keepAlive, long keepAliveIdle, long keepAliveInterval)
 
void finished (CURLcode errorCode)
 
bool reuse (const char *url, RequestHeaders *headersList, const Common::String &postFields, bool uploading=false, bool usingPatch=false) override
 
bool reuse (const char *url, RequestHeaders *headersList, const Common::HashMap< Common::String, Common::String > &formFields, const Common::HashMap< Common::String, Common::Path > &formFiles) override
 
bool reuse (const char *url, RequestHeaders *headersList, const byte *buffer, uint32 bufferSize, bool uploading=false, bool usingPatch=false, bool post=true) override
 
void setProgress (uint64 downloaded, uint64 total)
 
double getProgress () const override
 
uint32 read (void *dataPtr, uint32 dataSize) override
 
long httpResponseCode () const override
 
Common::String currentLocation () const override
 
Common::HashMap< Common::String, Common::StringresponseHeadersMap () const override
 
bool hasError () const override
 
const char * getError () const override
 
- Public Member Functions inherited from Networking::NetworkReadStream
bool eos () const override
 
bool keepAlive () 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)
 
SeekableReadStreamreadStream (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 ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Networking::NetworkReadStream
static NetworkReadStreammake (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 NetworkReadStreammake (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 NetworkReadStreammake (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)
 
- Protected Member Functions inherited from Networking::NetworkReadStream
 NetworkReadStream (bool keepAlive, long keepAliveIdle, long keepAliveInterval)
 
- Protected Attributes inherited from Networking::NetworkReadStream
bool _keepAlive
 
long _keepAliveIdle
 
long _keepAliveInterval
 
bool _eos
 

Member Function Documentation

◆ reuse() [1/3]

bool Networking::NetworkReadStreamCurl::reuse ( const char *  url,
RequestHeaders headersList,
const Common::String postFields,
bool  uploading = false,
bool  usingPatch = false 
)
overridevirtual

Send <postFields>, using POST by default.

Implements Networking::NetworkReadStream.

◆ reuse() [2/3]

bool Networking::NetworkReadStreamCurl::reuse ( const char *  url,
RequestHeaders headersList,
const Common::HashMap< Common::String, Common::String > &  formFields,
const Common::HashMap< Common::String, Common::Path > &  formFiles 
)
overridevirtual

Send <formFields>, <formFiles>, using POST multipart/form.

Implements Networking::NetworkReadStream.

◆ reuse() [3/3]

bool Networking::NetworkReadStreamCurl::reuse ( const char *  url,
RequestHeaders headersList,
const byte *  buffer,
uint32  bufferSize,
bool  uploading = false,
bool  usingPatch = false,
bool  post = true 
)
overridevirtual

Send <buffer>, using POST by default.

Implements Networking::NetworkReadStream.

◆ setProgress()

void Networking::NetworkReadStreamCurl::setProgress ( uint64  downloaded,
uint64  total 
)

Used in curl progress callback to pass current downloaded/total values.

◆ getProgress()

double Networking::NetworkReadStreamCurl::getProgress ( ) const
overridevirtual

Returns a number in range [0, 1], where 1 is "complete".

Implements Networking::NetworkReadStream.

◆ read()

uint32 Networking::NetworkReadStreamCurl::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
dataPtrpointer to a buffer into which the data is read
dataSizenumber of bytes to be read
Returns
the number of bytes which were actually read.

Implements Networking::NetworkReadStream.

◆ httpResponseCode()

long Networking::NetworkReadStreamCurl::httpResponseCode ( ) const
overridevirtual

Returns HTTP response code from inner CURL handle. It returns -1 to indicate there is no inner handle.

Note
This method should be called when eos() == true.

Implements Networking::NetworkReadStream.

◆ currentLocation()

Common::String Networking::NetworkReadStreamCurl::currentLocation ( ) const
overridevirtual

Return current location URL from inner CURL handle. "" is returned to indicate there is no inner handle.

Note
This method should be called when eos() == true.

Implements Networking::NetworkReadStream.

◆ responseHeadersMap()

Common::HashMap<Common::String, Common::String> Networking::NetworkReadStreamCurl::responseHeadersMap ( ) const
overridevirtual

Return response headers as HashMap. All header names in it are lowercase.

Note
This method should be called when eos() == true.

Implements Networking::NetworkReadStream.


The documentation for this class was generated from the following file: