apt  2.2.4
About: Apt (Advanced Package Tool) is a management system for software packages (Debian/Ubuntu). Release series 2.2.
  Fossies Dox: apt-2.2.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

cdrom.h
Go to the documentation of this file.
1 #ifndef PKGLIB_CDROM_H
2 #define PKGLIB_CDROM_H
3 
4 #include <apt-pkg/macros.h>
5 
6 #include <string>
7 #include <vector>
8 
9 #include <stddef.h>
10 
11 
12 class Configuration;
13 class OpProgress;
14 
16 {
17  void * const d;
18  protected:
20 
21  public:
23  virtual ~~pkgCdromStatus();
24 
25  // total steps
26  virtual void SetTotal(int total) { totalSteps = total; };
27  // update steps, will be called regularly as a "pulse"
28  virtual void Update(std::string text="", int current=0) = 0;
29 
30  // ask for cdrom insert
31  virtual bool ChangeCdrom() = 0;
32  // ask for cdrom name
33  virtual bool AskCdromName(std::string &Name) = 0;
34  // Progress indicator for the Index rewriter
35  virtual OpProgress* GetOpProgress() {return NULL; };
36 };
37  /*}}}*/
38 class APT_PUBLIC pkgCdrom /*{{{*/
39 {
40  protected:
41  enum {
42  STEP_PREPARE = 1,
51  STEP_LAST
52  };
53 
54 
55  bool FindPackages(std::string CD,
56  std::vector<std::string> &List,
57  std::vector<std::string> &SList,
58  std::vector<std::string> &SigList,
59  std::vector<std::string> &TransList,
60  std::string &InfoDir, pkgCdromStatus *log,
61  unsigned int Depth = 0);
62  bool DropBinaryArch(std::vector<std::string> &List);
63  bool DropRepeats(std::vector<std::string> &List,const char *Name);
64  bool DropTranslation(std::vector<std::string> &List);
65  void ReduceSourcelist(std::string CD,std::vector<std::string> &List);
66  bool WriteDatabase(Configuration &Cnf);
67  bool WriteSourceList(std::string Name,std::vector<std::string> &List,bool Source);
68  int Score(std::string Path);
69 
70  public:
71  bool Ident(std::string &ident, pkgCdromStatus *log);
72  bool Add(pkgCdromStatus *log);
73 
74  pkgCdrom();
75  virtual ~~pkgCdrom();
76 
77  private:
78  void * const d;
79 
80  APT_HIDDEN bool MountAndIdentCDROM(Configuration &Database, std::string &CDROM,
81  std::string &ident, pkgCdromStatus * const log, bool const interactive);
82  APT_HIDDEN bool UnmountCDROM(std::string const &CDROM, pkgCdromStatus * const log);
83 };
84  /*}}}*/
85 
86 
87 // class that uses libudev to find cdrom/removable devices dynamically
88 struct APT_PUBLIC CdromDevice /*{{{*/
89 {
90  std::string DeviceName;
91  bool Mounted;
92  std::string MountPath;
93 };
94  /*}}}*/
96 {
97  void * const d;
98  public:
100  virtual ~~pkgUdevCdromDevices();
101 
102  // convenience interface, this will just call ScanForRemovable
103  // with "APT::cdrom::CdromOnly"
104  std::vector<CdromDevice> Scan();
105 
106  std::vector<CdromDevice> ScanForRemovable(bool CdromOnly);
107 };
108  /*}}}*/
109 
110 #endif
int totalSteps
Definition: cdrom.h:19
virtual bool ChangeCdrom()=0
virtual OpProgress * GetOpProgress()
Definition: cdrom.h:35
virtual void SetTotal(int total)
Definition: cdrom.h:26
virtual bool AskCdromName(std::string &Name)=0
virtual void Update(std::string text="", int current=0)=0
void *const d
Definition: cdrom.h:17
Definition: cdrom.h:39
@ STEP_IDENT
Definition: cdrom.h:46
@ STEP_UNMOUNT3
Definition: cdrom.h:50
@ STEP_WRITE
Definition: cdrom.h:49
@ STEP_MOUNT
Definition: cdrom.h:45
@ STEP_WAIT
Definition: cdrom.h:44
@ STEP_COPY
Definition: cdrom.h:48
@ STEP_UNMOUNT
Definition: cdrom.h:43
@ STEP_SCAN
Definition: cdrom.h:47
void *const d
Definition: cdrom.h:78
void *const d
Definition: cdrom.h:97
#define APT_PUBLIC
Definition: macros.h:77
#define APT_HIDDEN
Definition: macros.h:78
std::string MountPath
Definition: cdrom.h:92
bool Mounted
Definition: cdrom.h:91
std::string DeviceName
Definition: cdrom.h:90