| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- // -*- mode: cpp; mode: fold -*-
- // Description /*{{{*/
- // $Id: acquire-item.h,v 1.4 1998/10/26 07:11:44 jgg Exp $
- /* ######################################################################
- Acquire Item - Item to acquire
- When an item is instantiated it will add it self to the local list in
- the Owner Acquire class. Derived classes will then call QueueURI to
- register all the URI's they wish to fetch for at the initial moment.
-
- Two item classes are provided to provide functionality for downloading
- of Index files and downloading of Packages.
-
- ##################################################################### */
- /*}}}*/
- #ifndef PKGLIB_ACQUIRE_ITEM_H
- #define PKGLIB_ACQUIRE_ITEM_H
- #include <apt-pkg/acquire.h>
- #include <apt-pkg/sourcelist.h>
- #ifdef __GNUG__
- #pragma interface "apt-pkg/acquire-item.h"
- #endif
- // Item to acquire
- class pkgAcquire::Item
- {
- protected:
-
- pkgAcquire *Owner;
- inline void QueueURI(string URI,string Description)
- {Owner->Enqueue(this,URI,Description);};
-
- void Rename(string From,string To);
-
- public:
- // State of the item
- enum {StatIdle, StatFetching, StatDone, StatError} Status;
- string ErrorText;
-
- // Number of queues we are inserted into
- unsigned int QueueCounter;
-
- // File to write the fetch into
- string DestFile;
-
- virtual void Failed(string Message);
- virtual void Done(string Message,unsigned long Size,string Md5Hash);
- virtual string Custom600Headers() {return string();};
-
- Item(pkgAcquire *Owner);
- virtual ~Item();
- };
- // Item class for index files
- class pkgAcqIndex : public pkgAcquire::Item
- {
- protected:
-
- const pkgSourceList::Item *Location;
- bool Decompression;
-
- public:
-
- virtual void Done(string Message,unsigned long Size,string Md5Hash);
- virtual string Custom600Headers();
- pkgAcqIndex(pkgAcquire *Owner,const pkgSourceList::Item *Location);
- };
- // Item class for index files
- class pkgAcqIndexRel : public pkgAcquire::Item
- {
- protected:
-
- const pkgSourceList::Item *Location;
-
- public:
-
- virtual void Done(string Message,unsigned long Size,string Md5Hash);
- virtual string Custom600Headers();
-
- pkgAcqIndexRel(pkgAcquire *Owner,const pkgSourceList::Item *Location);
- };
- #endif
|