Download Class ReferenceClass containing the state of a download. More...
Public Member Functions
|Download (const string &uri, Output *o)|
|void||setResumeOffset (uint64 offset)|
|Set offset to resume from - download must not yet have been started, call before run(). |
|uint64||resumeOffset () const|
|Value passed to setResumeOffset(). |
|Whether to send a "Pragma: no-cache" header. |
|const string &||uri () const|
|Pause the request. |
|Continue with the download. |
|bool||paused () const|
|Is the download paused? (i.e. |
|bool||failed () const|
|Is the download paused, or is it not yet paused, but will be soon? |
|bool||succeeded () const|
|Is download finished? (Also returns true if FTP/HTTP1.0 connection dropped). |
|bool||interrupted () const|
|The connection was interrupted during the download, or it timed out. |
|Forcibly stop this download. |
|Output *||output () const|
|Return the Output object. |
|void||setOutput (Output *o)|
|Set the Output object. |
Static Public Member Functions
|static void||init ()|
|Initialize libwww - call this before starting any downloads. |
|static void||cleanup ()|
|Clean up - call this after all requests are finished. |
|A derived class of Output must be supplied by the user of Download, to take care of the downloaded data and to output progress reports. More...|
Detailed DescriptionClass containing the state of a download.
libwww must be properly initialised before usage (this happens in glibwww-init.cc).
The purpose of this class is a minimal API for downloading HTTP and FTP URLs. A few useful extra features are added by Job::SingleURL.
Constructor & Destructor Documentation
|Download::Download||(||const string &||uri,|
Member Function Documentation
|uint64 Download::resumeOffset||(||)|| const
Whether to send a "Pragma: no-cache" header.
The header is sent iff pragmaNoCache==true. Caution: The setting is not reset after the download has finished/failed and will be reused if you re-run(), so better *always* call this immediately before run(). Start downloading. Returns (almost) immediately and runs the download in the background via the glib/libwww event loop. If resumeOffset > 0, continue downloading the data from a given byte position. If a resume is not possible (e.g. server does not support HTTP ranges), there's an error.
Referenced by Job::SingleUrl::run().
|const string & Download::uri||(||)|| const
Referenced by Job::SingleUrl::location().
|bool Download::paused||(||)|| const
|bool Download::failed||(||)|| const
Is the download paused, or is it not yet paused, but will be soon?
Did the download fail with an error?
Referenced by Job::SingleUrl::failed().
|bool Download::succeeded||(||)|| const
Is download finished? (Also returns true if FTP/HTTP1.0 connection dropped).
Referenced by Job::SingleUrl::succeeded().
|bool Download::interrupted||(||)|| const
The connection was interrupted during the download, or it timed out.
Referenced by Job::SingleUrl::resumePossible().
Forcibly stop this download.
Careful, in case we are pipelining it is unavoidable that other (pending and not pending) downloads in the same pipeline also fail; they'll have to be resumed. [outofdate:stop() must not be called when libwww is delivering data, i.e. you must not call it from your download_data() method.] stop() is special in that it neither calls job_failed() nor job_succeeded(). Usually, you will have to call one or the other (depending on context) to notify everyone that the request was stopped.
Referenced by Job::SingleUrl::stop().
The documentation for this class was generated from the following files:
Generated on Tue Sep 23 14:27:42 2008 for jigdo by 1.5.6