DownloadNode Class Reference

Download Queue Node. This is a subclass of the QueueNode type that is used for download requests in the queue. More...

#include <queuenode.h>

Inheritance diagram for DownloadNode:

QueueNode List of all members.

Public Member Functions

 DownloadNode (Server *pcServer, const String &zLocalPath, const String &zRemotePath, int nID)
 DownloadNode Constructor. Sets the initial download file location to null.
 ~DownloadNode ()
 DownloadNode Deconstructor. This frees up the file pointer m_pcFile if necessary.

Private Member Functions

CURLcode AttachToHandle (CURL *pHandle)
 Setup Function for Curl Transfer. Configures the given CURL handle to perform this transfer, such as setting the url.
CURLcode RemoveFromHandle (CURL *pHandle)
 Remove any settings from the curl handle set in AttachToHandle().
size_t Write (void *pBuf, size_t nSize)
 Write to file. This performs the actual writing of data to the file.
int Seek (curl_off_t nOffset, int nOrigin)
 Performs a seek operation on the file. Seek into a particular position in the file so curl can begin operating from there.
int ProgressBar (double fDownTotal, double fDownNow, double fUpTotal, double fUpNow)
 Updates the progress bar. This just outputs progress information to the terminal.

Private Attributes

File * m_pcFile

Friends

class TransferThread

Detailed Description

Download Queue Node. This is a subclass of the QueueNode type that is used for download requests in the queue.


Member Function Documentation

size_t DownloadNode::Write ( void *  pBuf,
size_t  nSize 
) [private, virtual]

Write to file. This performs the actual writing of data to the file.

Parameters:
pBuf The data to write to the file.
nSize The size of the data being written.
Returns:
The amount of data actually written.

Reimplemented from QueueNode.

int DownloadNode::Seek ( curl_off_t  nOffset,
int  nOrigin 
) [private, virtual]

Performs a seek operation on the file. Seek into a particular position in the file so curl can begin operating from there.

Parameters:
nOffset The offset into the file to start operating at.
nOrigin The origin of the offset.
Todo:
Make sure that File::Seek() returns the same as libcurl expects.

Reimplemented from QueueNode.

int DownloadNode::ProgressBar ( double  fDownTotal,
double  fDownNow,
double  fUpTotal,
double  fUpNow 
) [private, virtual]

Updates the progress bar. This just outputs progress information to the terminal.

Parameters:
fDownTotal Total bytes to be downloaded.
fDownNow Total bytes downloaded so far.
fUpTotal Total bytes to upload.
fUpNow Total bytes uploaded at the moment.

Reimplemented from QueueNode.


Member Data Documentation

File* DownloadNode::m_pcFile [private]

A pointer to the file that is being downloaded.


The documentation for this class was generated from the following files:
Generated on Fri Jan 2 17:23:16 2009 for Transferrer by  doxygen 1.5.1