ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Networking::CurlRequest Class Reference

#include <curlrequest.h>

Inheritance diagram for Networking::CurlRequest:
Collaboration diagram for Networking::CurlRequest:

List of all members.

Public Member Functions

 CurlRequest (DataCallback cb, ErrorCallback ecb, Common::String url)
virtual ~CurlRequest ()
virtual void handle ()
 Method, which does actual work.
virtual void restart ()
 Method, which is used to restart the Request.
virtual Common::String date () const
 Return date this Request received from server.
virtual void setHeaders (Common::Array< Common::String > &headers)
 Replaces all headers with the passed array of headers.
virtual void addHeader (Common::String header)
 Adds a header into headers list.
virtual void addPostField (Common::String field)
 Adds a post field (key=value pair).
virtual void addFormField (Common::String name, Common::String value)
 Adds a form/multipart field (name, value).
virtual void addFormFile (Common::String name, Common::String filename)
 Adds a form/multipart file (field name, file name).
virtual void setBuffer (byte *buffer, uint32 size)
 Sets bytes buffer.
virtual void usePut ()
 Remembers to use PUT method when it would create NetworkReadStream.
virtual void usePatch ()
 Remembers to use PATCH method when it would create NetworkReadStream.
virtual void connectionKeepAlive (long idle=120, long interval=60)
 Remembers to use Connection: keep-alive or close.
virtual void connectionClose ()
virtual NetworkReadStreamResponse execute ()
 Starts this Request with ConnMan.
const NetworkReadStreamgetNetworkReadStream () const
 Returns Request's NetworkReadStream.
void wait (int spinlockDelay=5)
 Waits for Request to be processed.

Protected Member Functions

virtual NetworkReadStreammakeStream ()

Protected Attributes

Common::String _url
NetworkReadStream_stream
curl_slist * _headersList
Common::String _postFields
Common::HashMap
< Common::String,
Common::String
_formFields
Common::HashMap
< Common::String,
Common::String
_formFiles
byte_bytesBuffer
uint32 _bytesBufferSize
bool _uploading
bool _usingPatch
bool _keepAlive
long _keepAliveIdle
long _keepAliveInterval

Detailed Description

Definition at line 41 of file curlrequest.h.


Constructor & Destructor Documentation

Networking::CurlRequest::CurlRequest ( DataCallback  cb,
ErrorCallback  ecb,
Common::String  url 
)

Definition at line 33 of file curlrequest.cpp.

Networking::CurlRequest::~CurlRequest (  )  [virtual]

Definition at line 37 of file curlrequest.cpp.


Member Function Documentation

void Networking::CurlRequest::addFormField ( Common::String  name,
Common::String  value 
) [virtual]

Adds a form/multipart field (name, value).

Definition at line 105 of file curlrequest.cpp.

void Networking::CurlRequest::addFormFile ( Common::String  name,
Common::String  filename 
) [virtual]

Adds a form/multipart file (field name, file name).

Definition at line 115 of file curlrequest.cpp.

void Networking::CurlRequest::addHeader ( Common::String  header  )  [virtual]

Adds a header into headers list.

Reimplemented in Cloud::Box::BoxTokenRefresher, Cloud::GoogleDrive::GoogleDriveTokenRefresher, and Cloud::OneDrive::OneDriveTokenRefresher.

Definition at line 88 of file curlrequest.cpp.

void Networking::CurlRequest::addPostField ( Common::String  field  )  [virtual]

Adds a post field (key=value pair).

Definition at line 92 of file curlrequest.cpp.

void Networking::CurlRequest::connectionClose (  )  [virtual]

Definition at line 146 of file curlrequest.cpp.

void Networking::CurlRequest::connectionKeepAlive ( long  idle = 120,
long  interval = 60 
) [virtual]

Remembers to use Connection: keep-alive or close.

Definition at line 140 of file curlrequest.cpp.

Common::String Networking::CurlRequest::date (  )  const [virtual]

Return date this Request received from server.

It could be extracted from "Date" header, which is kept in NetworkReadStream.

Note:
not all Requests do that, so "" is returned to indicate the date is unknown. That's also true if no server response available or no "Date" header was passed.
Returns:
date from "Date" response header.

Reimplemented from Networking::Request.

Definition at line 72 of file curlrequest.cpp.

NetworkReadStreamResponse Networking::CurlRequest::execute (  )  [virtual]

Starts this Request with ConnMan.

Returns:
its NetworkReadStream in NetworkReadStreamResponse.

Definition at line 150 of file curlrequest.cpp.

const NetworkReadStream * Networking::CurlRequest::getNetworkReadStream (  )  const

Returns Request's NetworkReadStream.

Definition at line 159 of file curlrequest.cpp.

void Networking::CurlRequest::handle (  )  [virtual]

Method, which does actual work.

Depends on what this Request is doing.

Implements Networking::Request.

Reimplemented in Networking::CurlJsonRequest, and Networking::SessionRequest.

Definition at line 50 of file curlrequest.cpp.

NetworkReadStream * Networking::CurlRequest::makeStream (  )  [protected, virtual]

Definition at line 42 of file curlrequest.cpp.

void Networking::CurlRequest::restart (  )  [virtual]

Method, which is used to restart the Request.

Implements Networking::Request.

Reimplemented in Networking::CurlJsonRequest, and Networking::SessionRequest.

Definition at line 65 of file curlrequest.cpp.

void Networking::CurlRequest::setBuffer ( byte buffer,
uint32  size 
) [virtual]

Sets bytes buffer.

Definition at line 125 of file curlrequest.cpp.

void Networking::CurlRequest::setHeaders ( Common::Array< Common::String > &  headers  )  [virtual]

Replaces all headers with the passed array of headers.

Reimplemented in Cloud::Box::BoxTokenRefresher, Cloud::GoogleDrive::GoogleDriveTokenRefresher, and Cloud::OneDrive::OneDriveTokenRefresher.

Definition at line 81 of file curlrequest.cpp.

void Networking::CurlRequest::usePatch (  )  [virtual]

Remembers to use PATCH method when it would create NetworkReadStream.

Definition at line 138 of file curlrequest.cpp.

void Networking::CurlRequest::usePut (  )  [virtual]

Remembers to use PUT method when it would create NetworkReadStream.

Definition at line 136 of file curlrequest.cpp.

void Networking::CurlRequest::wait ( int  spinlockDelay = 5  ) 

Waits for Request to be processed.

Should be called after Request is put into ConnMan.

Definition at line 161 of file curlrequest.cpp.


Member Data Documentation

Definition at line 49 of file curlrequest.h.

Definition at line 50 of file curlrequest.h.

curl_slist* Networking::CurlRequest::_headersList [protected]

Definition at line 45 of file curlrequest.h.

Definition at line 53 of file curlrequest.h.

Definition at line 54 of file curlrequest.h.

Definition at line 54 of file curlrequest.h.

Definition at line 46 of file curlrequest.h.

Definition at line 44 of file curlrequest.h.

Definition at line 51 of file curlrequest.h.

Definition at line 43 of file curlrequest.h.

Definition at line 52 of file curlrequest.h.


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


Generated on Sat Sep 19 2020 05:05:57 for ResidualVM by doxygen 1.7.1
curved edge   curved edge