input_curl Class Reference

#include <curl.h>

Inheritance diagram for input_curl:

input_ty

Public Member Functions

virtual ~input_curl ()
 input_curl (const nstring &url)
void progress_callback (double down_total, double down_current)
size_t write_callback (char *data, size_t nbytes)
void read_error ()
nstring name ()
long length ()
long read_inner (void *data, size_t nbytes)
long ftell_inner ()
bool is_remote () const
bool verify_handle (CURL *x) const
void eof_notify ()

Static Public Member Functions

static bool looks_likely (const nstring &fn)

Private Member Functions

long read_data (void *data, size_t len)
 input_curl ()
 input_curl (const input_curl &arg)
input_curloperator= (const input_curl &arg)

Private Attributes

CURL * handle
nstring fn
long pos
char * curl_buffer
size_t curl_buffer_maximum
size_t curl_buffer_position
size_t curl_buffer_length
bool eof
char errbuf [CURL_ERROR_SIZE]
time_t progress_start
char * progress_buffer
int progress_buflen
int progress_cleanup
nstring proxy
nstring userpass

Detailed Description

The input_curl class is used to represent an input obtained via libcurl.

Definition at line 31 of file curl.h.


Constructor & Destructor Documentation

virtual input_curl::~input_curl (  )  [virtual]

The destructor.

input_curl::input_curl ( const nstring url  ) 

The constructor.

input_curl::input_curl (  )  [private]

The default constructor. Do not use.

input_curl::input_curl ( const input_curl arg  )  [private]

The copy constructor. Do not use.


Member Function Documentation

static bool input_curl::looks_likely ( const nstring fn  )  [static]

The looks_likely class method is used to examine a filename and see if it starts with a prototype name (e.g. http: or ftp:) making it a likely candidate for the input_curl class.

void input_curl::progress_callback ( double  down_total,
double  down_current 
)

size_t input_curl::write_callback ( char *  data,
size_t  nbytes 
)

void input_curl::read_error (  ) 

nstring input_curl::name (  )  [virtual]

The name method is used to determine the name of the input.

Implements input_ty.

long input_curl::length (  )  [virtual]

The length method is used to determine the length of the input. May return -1 if the length is unknown.

Implements input_ty.

long input_curl::read_inner ( void *  data,
size_t  nbytes 
) [virtual]

The read_inner method is used to read unbuffered data from the given input stream. At most nbytes bytes will be read into data. The number of bytes actually read will be returned. At end-of-file, a value <= 0 will be returned, and data will be unchanged. All file read errors or format errors are fatal, and will cause the method to not return.

Parameters:
data Where to put the results of the read.
nbytes The maximum number of bytes to read.
Returns:
The actual number of bytes read, or zero for end-of-file.

Implements input_ty.

long input_curl::ftell_inner (  )  [virtual]

The ftell_inner method is used to determine the unbuffered current position within the input.

Implements input_ty.

bool input_curl::is_remote (  )  const [virtual]

The is_remote method is used to determine whether or not an input stream is from a local file or a remote source. This is only intended to be a generally informative thing, to provide information to the user, it isn't (and can't be) utterly precise.

Reimplemented from input_ty.

bool input_curl::verify_handle ( CURL *  x  )  const [inline]

Definition at line 76 of file curl.h.

void input_curl::eof_notify (  )  [inline]

Definition at line 78 of file curl.h.

long input_curl::read_data ( void *  data,
size_t  len 
) [private]

input_curl& input_curl::operator= ( const input_curl arg  )  [private]

The assignment operator. Do not use.


Field Documentation

CURL* input_curl::handle [private]

Definition at line 81 of file curl.h.

Definition at line 82 of file curl.h.

long input_curl::pos [private]

Definition at line 83 of file curl.h.

char* input_curl::curl_buffer [private]

Definition at line 86 of file curl.h.

Definition at line 89 of file curl.h.

Definition at line 92 of file curl.h.

Definition at line 95 of file curl.h.

bool input_curl::eof [private]

Definition at line 98 of file curl.h.

char input_curl::errbuf[CURL_ERROR_SIZE] [private]

Definition at line 100 of file curl.h.

time_t input_curl::progress_start [private]

Definition at line 102 of file curl.h.

char* input_curl::progress_buffer [private]

Definition at line 103 of file curl.h.

Definition at line 104 of file curl.h.

Definition at line 105 of file curl.h.

Definition at line 107 of file curl.h.

Definition at line 108 of file curl.h.


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

Generated on Wed Mar 12 23:37:40 2008 for Aegis by  doxygen 1.5.5