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)  

debindexfile.h
Go to the documentation of this file.
1 // -*- mode: cpp; mode: fold -*-
2 // Description /*{{{*/
3 /* ######################################################################
4 
5  Debian Index Files
6 
7  There are three sorts currently
8 
9  Package files that have File: tags
10  Package files that don't (/var/lib/dpkg/status)
11  Source files
12 
13  ##################################################################### */
14  /*}}}*/
15 #ifndef PKGLIB_DEBINDEXFILE_H
16 #define PKGLIB_DEBINDEXFILE_H
17 
18 #include <apt-pkg/indexfile.h>
19 #include <apt-pkg/pkgcache.h>
20 #include <apt-pkg/srcrecords.h>
21 
22 #include <string>
23 
24 class OpProgress;
25 class pkgAcquire;
26 class pkgCacheGenerator;
27 
29 {
30  void * const d;
31 protected:
32  virtual std::string GetArchitecture() const APT_OVERRIDE;
33  virtual std::string GetComponent() const APT_OVERRIDE;
34  virtual uint8_t GetIndexFlags() const APT_OVERRIDE;
35 
36 public:
37 
38  virtual const Type *GetType() const APT_OVERRIDE APT_PURE;
39 
40  // Interface for the Cache Generator
41  virtual bool HasPackages() const APT_OVERRIDE {return true;};
42  // Abort if the file does not exist.
43  virtual bool Exists() const APT_OVERRIDE {return true;};
44 
46 
47  explicit debStatusIndex(std::string const &File);
48  virtual ~debStatusIndex();
49 };
50 
52 {
53  void * const d;
54 protected:
55  virtual uint8_t GetIndexFlags() const APT_OVERRIDE;
56 
57 public:
58  virtual const Type *GetType() const APT_OVERRIDE APT_PURE;
59 
60  // Stuff for accessing files on remote items
61  virtual std::string ArchiveInfo(pkgCache::VerIterator const &Ver) const APT_OVERRIDE;
62 
63  // Interface for the Cache Generator
64  virtual bool HasPackages() const APT_OVERRIDE {return true;};
65 
66  debPackagesIndex(IndexTarget const &Target, bool const Trusted);
67  virtual ~debPackagesIndex();
68 };
69 
71 {
72  void * const d;
73 protected:
74  virtual std::string GetArchitecture() const APT_OVERRIDE;
75  virtual uint8_t GetIndexFlags() const APT_OVERRIDE;
76  virtual bool OpenListFile(FileFd &Pkg, std::string const &FileName) APT_OVERRIDE;
78 
79 public:
80 
81  virtual const Type *GetType() const APT_OVERRIDE APT_PURE;
82 
83  // Interface for the Cache Generator
84  virtual bool HasPackages() const APT_OVERRIDE;
85 
86  explicit debTranslationsIndex(IndexTarget const &Target);
87  virtual ~debTranslationsIndex();
88 };
89 
91 {
92  void * const d;
93  virtual uint8_t GetIndexFlags() const APT_OVERRIDE;
94  virtual bool OpenListFile(FileFd &Pkg, std::string const &FileName) APT_OVERRIDE;
96 
97  public:
98 
99  virtual const Type *GetType() const APT_OVERRIDE APT_PURE;
100 
101  // Stuff for accessing files on remote items
102  virtual std::string SourceInfo(pkgSrcRecords::Parser const &Record,
103  pkgSrcRecords::File const &File) const APT_OVERRIDE;
104 
105  // Interface for the record parsers
106  virtual pkgSrcRecords::Parser *CreateSrcParser() const APT_OVERRIDE;
107 
108  // Interface for the Cache Generator
109  virtual bool HasPackages() const APT_OVERRIDE {return false;};
110 
111  debSourcesIndex(IndexTarget const &Target, bool const Trusted);
112  virtual ~~debSourcesIndex();
113 };
114 
116 {
117  void * const d;
118  std::string DebFile;
119 
120 protected:
121  virtual std::string GetComponent() const APT_OVERRIDE;
122  virtual std::string GetArchitecture() const APT_OVERRIDE;
123  virtual uint8_t GetIndexFlags() const APT_OVERRIDE;
124  virtual bool OpenListFile(FileFd &Pkg, std::string const &FileName) APT_OVERRIDE;
126 
127 public:
128  virtual const Type *GetType() const APT_OVERRIDE APT_PURE;
129 
130  /** get the control (file) content of the deb file
131  *
132  * @param[out] content of the control file
133  * @param debfile is the filename of the .deb-file
134  * @return \b true if successful, otherwise \b false.
135  */
136  static bool GetContent(std::ostream &content, std::string const &debfile);
137 
138  // Interface for the Cache Generator
139  virtual bool HasPackages() const APT_OVERRIDE {return true;}
141 
142  // Interface for acquire
143 
144  explicit debDebPkgFileIndex(std::string const &DebFile);
145  virtual ~~debDebPkgFileIndex();
146 
147  std::string ArchiveInfo(pkgCache::VerIterator const &Ver) const override;
148 };
149 
151 {
152  void * const d;
153 
154 protected:
155  virtual std::string GetComponent() const APT_OVERRIDE;
156  virtual std::string GetArchitecture() const APT_OVERRIDE;
157  virtual uint8_t GetIndexFlags() const APT_OVERRIDE;
158 
159 public:
160  virtual const Type *GetType() const APT_OVERRIDE APT_PURE;
161  virtual pkgSrcRecords::Parser *CreateSrcParser() const APT_OVERRIDE;
162  virtual bool HasPackages() const APT_OVERRIDE {return false;};
163 
164  explicit debDscFileIndex(std::string const &DscFile);
165  virtual ~~debDscFileIndex();
166 };
167 
169 {
170 protected:
171  virtual std::string GetComponent() const APT_OVERRIDE;
172 
173 public:
174  virtual const Type *GetType() const APT_OVERRIDE APT_PURE;
175 };
176 
178 {
179  void * const d;
180 protected:
181  virtual std::string GetArchitecture() const APT_OVERRIDE;
182  virtual std::string GetComponent() const APT_OVERRIDE;
183  virtual uint8_t GetIndexFlags() const APT_OVERRIDE;
184 
185 public:
186  virtual const Type *GetType() const APT_OVERRIDE APT_PURE;
187 
188  // Interface for the Cache Generator
189  virtual bool HasPackages() const APT_OVERRIDE {return true;};
190  // Abort if the file does not exist.
191  virtual bool Exists() const APT_OVERRIDE {return true;};
192 
193  explicit debStringPackageIndex(std::string const &content);
194  virtual ~~debStringPackageIndex();
195 };
196 #endif
Definition: fileutl.h:39
Information about an index file.
Definition: indexfile.h:39
std::string DebFile
Definition: debindexfile.h:118
void *const d
Definition: debindexfile.h:152
virtual bool HasPackages() const APT_OVERRIDE
Definition: debindexfile.h:64
debPackagesIndex(IndexTarget const &Target, bool const Trusted)
Definition: debindexfile.cc:79
virtual const Type * GetType() const APT_OVERRIDE APT_PURE
virtual ~debPackagesIndex()
virtual uint8_t GetIndexFlags() const APT_OVERRIDE
virtual std::string ArchiveInfo(pkgCache::VerIterator const &Ver) const APT_OVERRIDE
Definition: debindexfile.cc:83
void *const d
Definition: debindexfile.h:53
void *const d
Definition: debindexfile.h:92
virtual bool HasPackages() const APT_OVERRIDE
Definition: debindexfile.h:41
virtual const Type * GetType() const APT_OVERRIDE APT_PURE
virtual uint8_t GetIndexFlags() const APT_OVERRIDE
virtual std::string GetArchitecture() const APT_OVERRIDE
virtual std::string GetComponent() const APT_OVERRIDE
virtual ~debStatusIndex()
debStatusIndex(std::string const &File)
void *const d
Definition: debindexfile.h:30
virtual bool Exists() const APT_OVERRIDE
Definition: debindexfile.h:43
virtual pkgCacheListParser * CreateListParser(FileFd &Pkg) APT_OVERRIDE
virtual bool Exists() const APT_OVERRIDE
Definition: debindexfile.h:191
virtual const Type * GetType() const APT_OVERRIDE APT_PURE
virtual uint8_t GetIndexFlags() const APT_OVERRIDE
virtual std::string GetArchitecture() const APT_OVERRIDE
virtual bool OpenListFile(FileFd &Pkg, std::string const &FileName) APT_OVERRIDE
virtual bool HasPackages() const APT_OVERRIDE
virtual APT_HIDDEN pkgCacheListParser * CreateListParser(FileFd &Pkg) APT_OVERRIDE
Represents the process by which a pkgAcquire object should retrieve a file or a collection of files.
Definition: acquire-item.h:59
virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const APT_OVERRIDE
Definition: indexfile.cc:352
virtual std::string GetComponent() const APT_OVERRIDE
Definition: indexfile.cc:232
IndexTarget const Target
Definition: indexfile.h:176
bool Trusted
Definition: indexfile.h:105
virtual std::string SourceInfo(pkgSrcRecords::Parser const &Record, pkgSrcRecords::File const &File) const
Definition: indexfile.cc:81
virtual std::string ArchiveInfo(pkgCache::VerIterator const &Ver) const
Definition: indexfile.cc:69
virtual pkgSrcRecords::Parser * CreateSrcParser() const
Definition: indexfile.h:138
#define APT_OVERRIDE
Definition: macros.h:111
#define APT_PURE
Definition: macros.h:56
#define APT_PUBLIC
Definition: macros.h:77
#define APT_HIDDEN
Definition: macros.h:78
pkgCache - Structure definitions for the cache file