Downloader Class Reference

#include <download.h>

List of all members.

Public Member Functions

 Downloader ()
 ~Downloader ()
bool Get (const char *url, const char *save_as)

Private Attributes

CURL * curl


Detailed Description

Definition at line 26 of file download.h.


Constructor & Destructor Documentation

Downloader::Downloader (  ) 

Definition at line 27 of file download.cpp.

00028 {
00029   curl = curl_easy_init();
00030 }

Downloader::~Downloader (  ) 

Definition at line 32 of file download.cpp.

00033 {
00034   curl_easy_cleanup(curl);
00035 }


Member Function Documentation

bool Downloader::Get ( const char *  url,
const char *  save_as 
)

Definition at line 43 of file download.cpp.

00044 {
00045   FILE* fd = fopen( save_as, "w");
00046   curl_easy_setopt(curl, CURLOPT_FILE, fd);
00047   curl_easy_setopt(curl, CURLOPT_URL, url);
00048   curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, download_callback);
00049   CURLcode r = curl_easy_perform(curl);
00050   fclose(fd);
00051 
00052   return (r == CURLE_OK);
00053 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

CURL* Downloader::curl [private]

Definition at line 28 of file download.h.


The documentation for this class was generated from the following files:
Generated on Mon Jan 1 13:44:40 2007 for Wormux by  doxygen 1.4.7