]> git.saurik.com Git - apt.git/blob - apt-pkg/cdrom.h
* removed the remaining #ifdef __GNUG__ that are no longer required
[apt.git] / apt-pkg / cdrom.h
1 #ifndef PKGLIB_CDROM_H
2 #define PKGLIB_CDROM_H
3
4 #include<apt-pkg/init.h>
5 #include<string>
6 #include<vector>
7
8
9 using namespace std;
10
11 class pkgCdromStatus
12 {
13 protected:
14 int totalSteps;
15
16 public:
17 pkgCdromStatus() {};
18 virtual ~pkgCdromStatus() {};
19
20 // total steps
21 virtual void SetTotal(int total) { totalSteps = total; };
22 // update steps, will be called regularly as a "pulse"
23 virtual void Update(string text="", int current=0) = 0;
24
25 // ask for cdrom insert
26 virtual bool ChangeCdrom() = 0;
27 // ask for cdrom name
28 virtual bool AskCdromName(string &Name) = 0;
29 // Progress indicator for the Index rewriter
30 virtual OpProgress* GetOpProgress() {return NULL; };
31 };
32
33 class pkgCdrom
34 {
35 protected:
36 enum {
37 STEP_PREPARE = 1,
38 STEP_UNMOUNT,
39 STEP_WAIT,
40 STEP_MOUNT,
41 STEP_IDENT,
42 STEP_SCAN,
43 STEP_COPY,
44 STEP_WRITE,
45 STEP_UNMOUNT3,
46 STEP_LAST
47 };
48
49
50 bool FindPackages(string CD,vector<string> &List,
51 vector<string> &SList, vector<string> &SigList,
52 string &InfoDir, pkgCdromStatus *log,
53 unsigned int Depth = 0);
54 bool DropBinaryArch(vector<string> &List);
55 bool DropRepeats(vector<string> &List,const char *Name);
56 void ReduceSourcelist(string CD,vector<string> &List);
57 bool WriteDatabase(Configuration &Cnf);
58 bool WriteSourceList(string Name,vector<string> &List,bool Source);
59 int Score(string Path);
60
61 public:
62 bool Ident(string &ident, pkgCdromStatus *log);
63 bool Add(pkgCdromStatus *log);
64 };
65
66
67
68 #endif