Public Member Functions

SourceMod::IWebTransfer Class Reference

Transfer interface. More...

#include <public/extensions/IWebternet.h>

List of all members.

Public Member Functions

virtual ~IWebTransfer ()
 Virtual destructor. Call delete to release the resources.
virtual const char * LastErrorMessage ()=0
 Returns a human-readable error message from the last failure.
virtual int LastErrorCode ()=0
 Returns the last error code, if any.
virtual bool SetHeaderReturn (bool recv_hdr)=0
 Sets whether header information is returned, if any.
virtual bool Download (const char *url, ITransferHandler *handler, void *data)=0
 Downloads a URL.
virtual bool PostAndDownload (const char *url, IWebForm *form, ITransferHandler *handler, void *data)=0
 Downloads a URL with POST options.
virtual bool SetFailOnHTTPError (bool fail)=0
 Sets whether an HTTP failure (>= 400) returns false from Download().

Detailed Description

Transfer interface.

Though one instance may be used across multiple threads, the interface cannot be modified while a transfer is in progress.

Definition at line 126 of file IWebternet.h.


Member Function Documentation

virtual const char* SourceMod::IWebTransfer::LastErrorMessage (  )  [pure virtual]

Returns a human-readable error message from the last failure.

Returns:
Error message.
virtual int SourceMod::IWebTransfer::LastErrorCode (  )  [pure virtual]

Returns the last error code, if any.

Returns:
Last error code.
virtual bool SourceMod::IWebTransfer::SetHeaderReturn ( bool  recv_hdr  )  [pure virtual]

Sets whether header information is returned, if any.

Parameters:
recv_hdr True to return headers, false otherwise.
Returns:
True on success, false on failure.
virtual bool SourceMod::IWebTransfer::Download ( const char *  url,
ITransferHandler handler,
void *  data 
) [pure virtual]

Downloads a URL.

Parameters:
url URL to download.
handler Handler object.
userdata User data pointer.
Returns:
True on success, false on failure.
virtual bool SourceMod::IWebTransfer::PostAndDownload ( const char *  url,
IWebForm form,
ITransferHandler handler,
void *  data 
) [pure virtual]

Downloads a URL with POST options.

Parameters:
url URL to download.
form Form to read POST info from.
handler Handler object.
userdata User data pointer.
Returns:
True on success, false on failure.
virtual bool SourceMod::IWebTransfer::SetFailOnHTTPError ( bool  fail  )  [pure virtual]

Sets whether an HTTP failure (>= 400) returns false from Download().

Note: defaults to false.

Parameters:
fail True to fail, false otherwise.
Returns:
True on success, false otherwise.

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