]>
Commit | Line | Data |
---|---|---|
0118833a AL |
1 | // -*- mode: cpp; mode: fold -*- |
2 | // Description /*{{{*/ | |
0a8a80e5 | 3 | // $Id: acquire-item.h,v 1.2 1998/10/22 04:56:39 jgg Exp $ |
0118833a AL |
4 | /* ###################################################################### |
5 | ||
6 | Acquire Item - Item to acquire | |
7 | ||
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. | |
11 | ||
12 | Two item classes are provided to provide functionality for downloading | |
13 | of Index files and downloading of Packages. | |
14 | ||
15 | ##################################################################### */ | |
16 | /*}}}*/ | |
17 | #ifndef PKGLIB_ACQUIRE_ITEM_H | |
18 | #define PKGLIB_ACQUIRE_ITEM_H | |
19 | ||
20 | #include <apt-pkg/acquire.h> | |
21 | #include <apt-pkg/sourcelist.h> | |
22 | ||
23 | #ifdef __GNUG__ | |
24 | #pragma interface "apt-pkg/acquire-item.h" | |
25 | #endif | |
26 | ||
27 | // Item to acquire | |
28 | class pkgAcquire::Item | |
29 | { | |
30 | protected: | |
31 | ||
32 | pkgAcquire *Owner; | |
0a8a80e5 AL |
33 | inline void QueueURI(string URI,string Description) |
34 | {Owner->Enqueue(this,URI,Description);}; | |
0118833a AL |
35 | |
36 | public: | |
37 | ||
0a8a80e5 | 38 | // Number of queues we are inserted into |
0118833a | 39 | unsigned int QueueCounter; |
0118833a | 40 | |
0a8a80e5 AL |
41 | // File to write the fetch into |
42 | string DestFile; | |
0118833a | 43 | |
0a8a80e5 AL |
44 | virtual void Failed() {}; |
45 | virtual string Custom600Headers() {return string();}; | |
46 | ||
0118833a AL |
47 | Item(pkgAcquire *Owner); |
48 | virtual ~Item(); | |
49 | }; | |
50 | ||
51 | // Item class for index files | |
52 | class pkgAcqIndex : public pkgAcquire::Item | |
53 | { | |
54 | protected: | |
55 | ||
56 | const pkgSourceList::Item *Location; | |
57 | ||
58 | public: | |
59 | ||
0a8a80e5 | 60 | virtual string Custom600Headers(); |
0118833a AL |
61 | |
62 | pkgAcqIndex(pkgAcquire *Owner,const pkgSourceList::Item *Location); | |
63 | }; | |
64 | ||
65 | // Item class for index files | |
66 | class pkgAcqIndexRel : public pkgAcquire::Item | |
67 | { | |
68 | protected: | |
69 | ||
70 | const pkgSourceList::Item *Location; | |
71 | ||
72 | public: | |
73 | ||
0a8a80e5 AL |
74 | virtual string Custom600Headers(); |
75 | ||
0118833a AL |
76 | pkgAcqIndexRel(pkgAcquire *Owner,const pkgSourceList::Item *Location); |
77 | }; | |
78 | ||
0118833a | 79 | #endif |