]>
git.saurik.com Git - apt.git/blob - apt-pkg/acquire-item.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: acquire-item.h,v 1.7 1998/11/11 06:54:14 jgg Exp $
4 /* ######################################################################
6 Acquire Item - Item to acquire
8 When an item is instantiated it will add it self to the local list in
9 the Owner Acquire class. Derived classes will then call QueueURI to
10 register all the URI's they wish to fetch for at the initial moment.
12 Two item classes are provided to provide functionality for downloading
13 of Index files and downloading of Packages.
15 ##################################################################### */
17 #ifndef PKGLIB_ACQUIRE_ITEM_H
18 #define PKGLIB_ACQUIRE_ITEM_H
20 #include <apt-pkg/acquire.h>
21 #include <apt-pkg/sourcelist.h>
24 #pragma interface "apt-pkg/acquire-item.h"
28 class pkgAcquire::Item
33 inline void QueueURI(ItemDesc
&Item
)
34 {Owner
->Enqueue(Item
);};
36 void Rename(string From
,string To
);
41 enum {StatIdle
, StatFetching
, StatDone
, StatError
} Status
;
43 unsigned long FileSize
;
48 // Number of queues we are inserted into
49 unsigned int QueueCounter
;
51 // File to write the fetch into
54 virtual void Failed(string Message
);
55 virtual void Done(string Message
,unsigned long Size
,string Md5Hash
);
56 virtual void Start(string Message
,unsigned long Size
);
58 virtual string
Custom600Headers() {return string();};
60 Item(pkgAcquire
*Owner
);
64 // Item class for index files
65 class pkgAcqIndex
: public pkgAcquire::Item
69 const pkgSourceList::Item
*Location
;
72 pkgAcquire::ItemDesc Desc
;
76 virtual void Done(string Message
,unsigned long Size
,string Md5Hash
);
77 virtual string
Custom600Headers();
79 pkgAcqIndex(pkgAcquire
*Owner
,const pkgSourceList::Item
*Location
);
82 // Item class for index files
83 class pkgAcqIndexRel
: public pkgAcquire::Item
87 const pkgSourceList::Item
*Location
;
88 pkgAcquire::ItemDesc Desc
;
92 virtual void Done(string Message
,unsigned long Size
,string Md5Hash
);
93 virtual string
Custom600Headers();
95 pkgAcqIndexRel(pkgAcquire
*Owner
,const pkgSourceList::Item
*Location
);