]>
Commit | Line | Data |
---|---|---|
b2e465d6 AL |
1 | // -*- mode: cpp; mode: fold -*- |
2 | // Description /*{{{*/ | |
b2e465d6 AL |
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 | ||
453b82a3 DK |
18 | #include <apt-pkg/indexfile.h> |
19 | #include <apt-pkg/cacheiterators.h> | |
20 | #include <apt-pkg/pkgcache.h> | |
21 | #include <apt-pkg/srcrecords.h> | |
13500573 | 22 | |
453b82a3 DK |
23 | #include <string> |
24 | ||
25 | class OpProgress; | |
26 | class pkgAcquire; | |
27 | class pkgCacheGenerator; | |
b2e465d6 | 28 | |
c9443c01 | 29 | class debStatusIndex : public pkgDebianIndexRealFile |
b2e465d6 | 30 | { |
6c55f07a | 31 | void * const d; |
c9443c01 DK |
32 | protected: |
33 | virtual std::string GetArchitecture() const APT_OVERRIDE; | |
34 | virtual std::string GetComponent() const APT_OVERRIDE; | |
35 | virtual uint8_t GetIndexFlags() const APT_OVERRIDE; | |
6d38011b | 36 | |
c9443c01 | 37 | public: |
b2e465d6 | 38 | |
6d7122b5 | 39 | virtual const Type *GetType() const APT_OVERRIDE APT_CONST; |
e3c1cfc7 | 40 | |
b2e465d6 | 41 | // Interface for the Cache Generator |
3b302846 | 42 | virtual bool HasPackages() const APT_OVERRIDE {return true;}; |
c9443c01 DK |
43 | // Abort if the file does not exist. |
44 | virtual bool Exists() const APT_OVERRIDE {return true;}; | |
b2e465d6 | 45 | |
c9443c01 | 46 | debStatusIndex(std::string const &File); |
862bafea | 47 | virtual ~debStatusIndex(); |
b2e465d6 | 48 | }; |
3809194b | 49 | |
c9443c01 | 50 | class debPackagesIndex : public pkgDebianIndexTargetFile |
e3c1cfc7 | 51 | { |
6c55f07a | 52 | void * const d; |
c9443c01 | 53 | protected: |
6d7122b5 | 54 | virtual uint8_t GetIndexFlags() const APT_OVERRIDE; |
e3c1cfc7 | 55 | |
c9443c01 | 56 | public: |
6d7122b5 | 57 | virtual const Type *GetType() const APT_OVERRIDE APT_CONST; |
b2e465d6 AL |
58 | |
59 | // Stuff for accessing files on remote items | |
c9443c01 | 60 | virtual std::string ArchiveInfo(pkgCache::VerIterator const &Ver) const APT_OVERRIDE; |
e3c1cfc7 | 61 | |
b2e465d6 | 62 | // Interface for the Cache Generator |
3b302846 | 63 | virtual bool HasPackages() const APT_OVERRIDE {return true;}; |
7db98ffc | 64 | |
e3c1cfc7 | 65 | debPackagesIndex(IndexTarget const &Target, bool const Trusted); |
862bafea | 66 | virtual ~debPackagesIndex(); |
b2e465d6 AL |
67 | }; |
68 | ||
c9443c01 | 69 | class debTranslationsIndex : public pkgDebianIndexTargetFile |
a52f938b | 70 | { |
6c55f07a | 71 | void * const d; |
c9443c01 DK |
72 | protected: |
73 | virtual std::string GetArchitecture() const APT_OVERRIDE; | |
74 | virtual uint8_t GetIndexFlags() const APT_OVERRIDE; | |
75 | virtual bool OpenListFile(FileFd &Pkg, std::string const &FileName) APT_OVERRIDE; | |
76 | APT_HIDDEN virtual pkgCacheListParser * CreateListParser(FileFd &Pkg) APT_OVERRIDE; | |
77 | ||
78 | public: | |
d38926ef | 79 | |
6d7122b5 | 80 | virtual const Type *GetType() const APT_OVERRIDE APT_CONST; |
a52f938b | 81 | |
a52f938b | 82 | // Interface for the Cache Generator |
3b302846 | 83 | virtual bool HasPackages() const APT_OVERRIDE; |
a52f938b | 84 | |
e3c1cfc7 | 85 | debTranslationsIndex(IndexTarget const &Target); |
862bafea | 86 | virtual ~debTranslationsIndex(); |
a52f938b OS |
87 | }; |
88 | ||
c9443c01 | 89 | class debSourcesIndex : public pkgDebianIndexTargetFile |
b2e465d6 | 90 | { |
6c55f07a | 91 | void * const d; |
6d7122b5 | 92 | virtual uint8_t GetIndexFlags() const APT_OVERRIDE; |
c9443c01 DK |
93 | virtual bool OpenListFile(FileFd &Pkg, std::string const &FileName) APT_OVERRIDE; |
94 | APT_HIDDEN virtual pkgCacheListParser * CreateListParser(FileFd &Pkg) APT_OVERRIDE; | |
95 | ||
b2e465d6 AL |
96 | public: |
97 | ||
6d7122b5 | 98 | virtual const Type *GetType() const APT_OVERRIDE APT_CONST; |
b2e465d6 AL |
99 | |
100 | // Stuff for accessing files on remote items | |
8f3ba4e8 | 101 | virtual std::string SourceInfo(pkgSrcRecords::Parser const &Record, |
3b302846 | 102 | pkgSrcRecords::File const &File) const APT_OVERRIDE; |
b2e465d6 AL |
103 | |
104 | // Interface for the record parsers | |
3b302846 | 105 | virtual pkgSrcRecords::Parser *CreateSrcParser() const APT_OVERRIDE; |
e3c1cfc7 | 106 | |
b2e465d6 | 107 | // Interface for the Cache Generator |
3b302846 | 108 | virtual bool HasPackages() const APT_OVERRIDE {return false;}; |
e3c1cfc7 DK |
109 | |
110 | debSourcesIndex(IndexTarget const &Target, bool const Trusted); | |
862bafea | 111 | virtual ~debSourcesIndex(); |
b2e465d6 AL |
112 | }; |
113 | ||
c9443c01 | 114 | class debDebPkgFileIndex : public pkgDebianIndexRealFile |
0d29b9d4 | 115 | { |
6c55f07a | 116 | void * const d; |
0d29b9d4 | 117 | std::string DebFile; |
0d29b9d4 | 118 | |
c9443c01 DK |
119 | protected: |
120 | virtual std::string GetComponent() const APT_OVERRIDE; | |
121 | virtual std::string GetArchitecture() const APT_OVERRIDE; | |
122 | virtual uint8_t GetIndexFlags() const APT_OVERRIDE; | |
123 | virtual bool OpenListFile(FileFd &Pkg, std::string const &FileName) APT_OVERRIDE; | |
124 | APT_HIDDEN virtual pkgCacheListParser * CreateListParser(FileFd &Pkg) APT_OVERRIDE; | |
0d29b9d4 | 125 | |
c9443c01 | 126 | public: |
6d7122b5 | 127 | virtual const Type *GetType() const APT_OVERRIDE APT_CONST; |
0d29b9d4 | 128 | |
2f6a2fbb DK |
129 | /** get the control (file) content of the deb file |
130 | * | |
131 | * @param[out] content of the control file | |
132 | * @param debfile is the filename of the .deb-file | |
133 | * @return \b true if successful, otherwise \b false. | |
134 | */ | |
135 | static bool GetContent(std::ostream &content, std::string const &debfile); | |
136 | ||
0d29b9d4 | 137 | // Interface for the Cache Generator |
c9443c01 | 138 | virtual bool HasPackages() const APT_OVERRIDE {return true;} |
3b302846 | 139 | virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const APT_OVERRIDE; |
0d29b9d4 MV |
140 | |
141 | // Interface for acquire | |
0d29b9d4 | 142 | |
5465192b | 143 | debDebPkgFileIndex(std::string const &DebFile); |
862bafea DK |
144 | virtual ~debDebPkgFileIndex(); |
145 | }; | |
070536e6 | 146 | |
c9443c01 | 147 | class debDscFileIndex : public pkgDebianIndexRealFile |
a49e7948 | 148 | { |
6c55f07a | 149 | void * const d; |
a49e7948 | 150 | public: |
6d7122b5 | 151 | virtual const Type *GetType() const APT_OVERRIDE APT_CONST; |
3b302846 | 152 | virtual pkgSrcRecords::Parser *CreateSrcParser() const APT_OVERRIDE; |
3b302846 | 153 | virtual bool HasPackages() const APT_OVERRIDE {return false;}; |
a49e7948 | 154 | |
5465192b | 155 | debDscFileIndex(std::string const &DscFile); |
c8a4ce6c | 156 | virtual ~debDscFileIndex(); |
a49e7948 MV |
157 | }; |
158 | ||
5465192b | 159 | class debDebianSourceDirIndex : public debDscFileIndex |
77da39b9 | 160 | { |
3809194b | 161 | public: |
6d7122b5 | 162 | virtual const Type *GetType() const APT_OVERRIDE APT_CONST; |
0d29b9d4 MV |
163 | }; |
164 | ||
b2e465d6 | 165 | #endif |