]>
git.saurik.com Git - apt.git/blob - apt-pkg/acquire-item.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: acquire-item.h,v 1.4 1998/10/26 07:11:44 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(string URI
,string Description
)
34 {Owner
->Enqueue(this,URI
,Description
);};
36 void Rename(string From
,string To
);
41 enum {StatIdle
, StatFetching
, StatDone
, StatError
} Status
;
44 // Number of queues we are inserted into
45 unsigned int QueueCounter
;
47 // File to write the fetch into
50 virtual void Failed(string Message
);
51 virtual void Done(string Message
,unsigned long Size
,string Md5Hash
);
53 virtual string
Custom600Headers() {return string();};
55 Item(pkgAcquire
*Owner
);
59 // Item class for index files
60 class pkgAcqIndex
: public pkgAcquire::Item
64 const pkgSourceList::Item
*Location
;
69 virtual void Done(string Message
,unsigned long Size
,string Md5Hash
);
70 virtual string
Custom600Headers();
72 pkgAcqIndex(pkgAcquire
*Owner
,const pkgSourceList::Item
*Location
);
75 // Item class for index files
76 class pkgAcqIndexRel
: public pkgAcquire::Item
80 const pkgSourceList::Item
*Location
;
84 virtual void Done(string Message
,unsigned long Size
,string Md5Hash
);
85 virtual string
Custom600Headers();
87 pkgAcqIndexRel(pkgAcquire
*Owner
,const pkgSourceList::Item
*Location
);