CurlEasy Class Reference

(Internal) CurlEasy is a class that provides an interface to the libcurl "easy" interface. More...

#include <librets/CurlEasy.h>

List of all members.

Public Member Functions

 CurlEasy ()
 ~CurlEasy ()
void SetVerbose (bool verbose)
 Enable verbose logging.
void SetDebugData (void *debugData)
 Provide to cURL a pointer to the opaque data that cURL in turn will use for the debugging callbacks.
void SetDebugFunction (curl_debug_callback debugFunction)
 Provide to cURL a reference to the method that cURL should invoke when performing the logging/debug function.
void SetHttpAuth (long httpAuth)
 Indicate to cURL the authentication methodology.
void SetCookieFile (std::string cookieFile)
 Indicate to cURL the name of the file to which cookies will be stored.
void SetWriteData (void *writeData)
 Provide to cURL a pointer to the opaque data that cURL in turn will use for the WriteData callbacks.
void SetWriteFunction (curl_write_callback writeFunction)
 Provide to cURL a reference to the method that cURL should invoke when trying to write data it accepts from the network.
void SetWriteHeaderData (void *headerData)
 Provide to cURL a pointer to the opaque data that cURL in turn will use for the WriteHeaderData callbacks.
void SetWriteHeaderFunction (curl_write_callback headerFunction)
 Provide to cURL a reference to the method that cURL should invoke when trying to write data it accepts from the network.
void SetUserCredentials (std::string username, std::string password)
 Provide to cURL the user name and the password to be used with the selected authentication method.
void SetHttpGet (bool httpGet)
 Indicate to cURL whether or not the GET or POST method should be used.
void SetPostFields (std::string postFields)
 Provide to cURL a string containing the fields to be used with the POST.
void SetHttpHeaders (const curl_slist *httpHeaders)
 Provide to cURL a list of headers and values to be sent as part of the http transaction.
void SetUrl (std::string url)
 Provide to cURL a string containing the URL to which the http transaction will be sent.
void SetProxyUrl (std::string url)
 Provide to cURL a string containing the URL of the proxy server.
void SetProxyPassword (std::string password)
 Provide to cURL the proxy authentication password if required.
void SetPrivateData (void *data)
 Provide to cURL a pointer to the private data associated with this request.
void SetShareHandle (CURLSH *shared)
 Provide to cURL a reference to the shared object.
void SetTimeout (int seconds)
 Provide to cURL an integer containing a timeout in seconds.
void SetSSLVerify (bool verify)
 Tell cURL whether or not to verify SSL connections.
void Perform ()
 Tell cURL to perform the current request.
long GetResponseCode ()
 Obtain the response code from cURL for the last transaction.
bool GetVerbose ()
 Get the current state of the verbose/logging flag.
CURL * GetEasyHandle ()
 Get the current handle to the cURL "Easy" structure.
curl_slist * GetCookieSlist ()
 Get a pointer to the cookie list from cURL.
void * GetPrivateData ()
 Get the private data associated with this request.
std::string GetUrl ()
 Get the url.
std::string GetVersion ()
 Get the current curl library version information.


Detailed Description

(Internal) CurlEasy is a class that provides an interface to the libcurl "easy" interface.

Constructor & Destructor Documentation

CurlEasy (  ) 

~CurlEasy (  ) 


Member Function Documentation

curl_slist* GetCookieSlist (  ) 

Get a pointer to the cookie list from cURL.

Returns:
A pointer to the curl_slist. See the libCURL documentation.

CURL* GetEasyHandle (  ) 

Get the current handle to the cURL "Easy" structure.

See the libCURL documentation.

void* GetPrivateData (  ) 

Get the private data associated with this request.

Returns:
A pointer to the private data.

long GetResponseCode (  ) 

Obtain the response code from cURL for the last transaction.

Because of the use of the cURL multi-interface, it is possible for the status to be zero until the entire transaction has been satisfied. It is assumed, therefore, that when this method is called, the caller desires the transaction to be completed. This method will therefore continue the request until a non-zero response is returned by cURL.

Returns:
An integer representation of the http response code.

std::string GetUrl (  ) 

Get the url.

Returns:
A string containing the url for this connection.

bool GetVerbose (  ) 

Get the current state of the verbose/logging flag.

Returns:
a boolean when TRUE, indicates that logging/verbosity is enabled.

std::string GetVersion (  ) 

Get the current curl library version information.

Returns:
A string representing the libCURL verison.

void Perform (  ) 

Tell cURL to perform the current request.

void SetCookieFile ( std::string  cookieFile  ) 

Indicate to cURL the name of the file to which cookies will be stored.

Parameters:
cookieFile A string containing the name of the cookie file.

void SetDebugData ( void *  debugData  ) 

Provide to cURL a pointer to the opaque data that cURL in turn will use for the debugging callbacks.

Parameters:
debugData A pointer to the opaque data to be given to cURL. Typically this is the "this" pointer for the class implementing the callback.

void SetDebugFunction ( curl_debug_callback  debugFunction  ) 

Provide to cURL a reference to the method that cURL should invoke when performing the logging/debug function.

Parameters:
debugFunction A static reference to the callback function.

void SetHttpAuth ( long  httpAuth  ) 

Indicate to cURL the authentication methodology.

See the libCURL documentation.

Parameters:
httpAuth The cURL authentication code.

void SetHttpGet ( bool  httpGet  ) 

Indicate to cURL whether or not the GET or POST method should be used.

Parameters:
httpGet A boolean when TRUE sets the GET method; when FALSE set the POST method.

void SetHttpHeaders ( const curl_slist *  httpHeaders  ) 

Provide to cURL a list of headers and values to be sent as part of the http transaction.

Parameters:
httpHeaders A list of headers. See the libCURL documentation.

void SetPostFields ( std::string  postFields  ) 

Provide to cURL a string containing the fields to be used with the POST.

Parameters:
postFields A string containg the fields to be used with the POST.

void SetPrivateData ( void *  data  ) 

Provide to cURL a pointer to the private data associated with this request.

Parameters:
data A pointer to the private data.

void SetProxyPassword ( std::string  password  ) 

Provide to cURL the proxy authentication password if required.

Parameters:
password A string containing the proxy password.

void SetProxyUrl ( std::string  url  ) 

Provide to cURL a string containing the URL of the proxy server.

The URL should include the proxy port.

Parameters:
url A string containing the proxy URL.

void SetShareHandle ( CURLSH *  shared  ) 

Provide to cURL a reference to the shared object.

Parameters:
shared A pointer to a CURLSH handle.

void SetSSLVerify ( bool  verify  ) 

Tell cURL whether or not to verify SSL connections.

Parameters:
verify A boolean that if TRUE (default), indicates that the connection should be verified.

void SetTimeout ( int  seconds  ) 

Provide to cURL an integer containing a timeout in seconds.

Parameters:
seconds An integer containing the number of seconds to establish as a timeout.

void SetUrl ( std::string  url  ) 

Provide to cURL a string containing the URL to which the http transaction will be sent.

Parameters:
url A string containing a URL.

void SetUserCredentials ( std::string  username,
std::string  password 
)

Provide to cURL the user name and the password to be used with the selected authentication method.

Parameters:
username A string containing the user name.
password A string containing the password.

void SetVerbose ( bool  verbose  ) 

Enable verbose logging.

Parameters:
verbose TRUE to enable logging, FALSE to disable it.

void SetWriteData ( void *  writeData  ) 

Provide to cURL a pointer to the opaque data that cURL in turn will use for the WriteData callbacks.

Parameters:
writeData A pointer to the opaque data to be given to cURL. Typically this is the "this" pointer for the class implementing the callback.

void SetWriteFunction ( curl_write_callback  writeFunction  ) 

Provide to cURL a reference to the method that cURL should invoke when trying to write data it accepts from the network.

Parameters:
writeFunction A static reference to the callback function.

void SetWriteHeaderData ( void *  headerData  ) 

Provide to cURL a pointer to the opaque data that cURL in turn will use for the WriteHeaderData callbacks.

Parameters:
headerData A pointer to the opaque data to be given to cURL. Typically this is the "this" pointer for the class implementing the callback.

void SetWriteHeaderFunction ( curl_write_callback  headerFunction  ) 

Provide to cURL a reference to the method that cURL should invoke when trying to write data it accepts from the network.

Parameters:
headerFunction A static reference to the callback function.


Generated by  doxygen