Main Page | Class List | File List | Class Members

CCurl Class Reference

#include <curl.h>

List of all members.

Public Member Functions

 CCurl ()
 ~CCurl ()
void fetchURI (const char *uri)
long getCode ()
char * getData ()

Static Protected Member Functions

static size_t write_data (void *ptr, size_t size, size_t nmemb, void *userp)


Detailed Description

This is a simple wrapper around the libCurl library, which allows the user to download the contents of an arbitary URI via a LUA script.

Sample usage looks like this:

   CCurl fetcher;
   fetcher.fetchURI( "http://localhost/" );
  
   data          = fetcher.getData();
   HTTP_Response = fetcher.getCode();

Version:
Id
curl.h,v 1.2 2005/10/08 14:43:23 steve Exp
Author:
Steve Kemp http://www.steve.org.uk


Constructor & Destructor Documentation

CCurl::CCurl  ) 
 

Constructor.

Returns:
A new CCurl object.

CCurl::~CCurl  ) 
 

Destructor. Tidy up and free memory.


Member Function Documentation

void CCurl::fetchURI const char *  uri  ) 
 

Download the named URI object.

Parameters:
uri The URI of the resource to download.

long CCurl::getCode  ) 
 

Get the HTTP status code for the previous transaction.

Returns:
The HTTP Status code of the previous download, via fetchURI
See also:
fetchURI

char * CCurl::getData  ) 
 

get the data from the page/object.

Returns:
The contents of the URI we download, via fetchURI
See also:
fetchURI

size_t CCurl::write_data void *  ptr,
size_t  size,
size_t  nmemb,
void *  userp
[static, protected]
 

Callback routine for libCurl.

Parameters:
ptr A pointer to the data chunk downloaded.
size The size of data we are being passed.
nmemb The size of each byte of data included in size.
userp A user-supplied pointer.
Returns:
The amount of data successfully managed (and added to our m_data buffer).


The documentation for this class was generated from the following files:
Generated on Tue Oct 25 23:04:38 2005 for fortress by  doxygen 1.4.2