]>
Commit | Line | Data |
---|---|---|
b2e465d6 AL |
1 | // -*- mode: cpp; mode: fold -*- |
2 | // Description /*{{{*/ | |
7db98ffc | 3 | // $Id: debindexfile.h,v 1.3.2.1 2003/12/24 23:09:17 mdz Exp $ |
b2e465d6 AL |
4 | /* ###################################################################### |
5 | ||
6 | Debian Index Files | |
7 | ||
8 | There are three sorts currently | |
9 | ||
10 | Package files that have File: tags | |
11 | Package files that don't (/var/lib/dpkg/status) | |
12 | Source files | |
13 | ||
14 | ##################################################################### */ | |
15 | /*}}}*/ | |
16 | #ifndef PKGLIB_DEBINDEXFILE_H | |
17 | #define PKGLIB_DEBINDEXFILE_H | |
18 | ||
13500573 | 19 | |
b2e465d6 AL |
20 | |
21 | #include <apt-pkg/indexfile.h> | |
22 | ||
23 | class debStatusIndex : public pkgIndexFile | |
24 | { | |
ff72bd0d MV |
25 | /** \brief dpointer placeholder (for later in case we need it) */ |
26 | void *d; | |
36b8ebbb | 27 | |
6d38011b | 28 | protected: |
8f3ba4e8 | 29 | std::string File; |
6d38011b | 30 | |
b2e465d6 AL |
31 | public: |
32 | ||
33 | virtual const Type *GetType() const; | |
34 | ||
35 | // Interface for acquire | |
65512241 | 36 | virtual std::string Describe(bool /*Short*/) const {return File;}; |
b2e465d6 AL |
37 | |
38 | // Interface for the Cache Generator | |
39 | virtual bool Exists() const; | |
40 | virtual bool HasPackages() const {return true;}; | |
41 | virtual unsigned long Size() const; | |
2e5f4e45 | 42 | virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; |
6d38011b | 43 | bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog, unsigned long const Flag) const; |
b2e465d6 AL |
44 | virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; |
45 | ||
8f3ba4e8 | 46 | debStatusIndex(std::string File); |
ff72bd0d | 47 | virtual ~debStatusIndex() {}; |
b2e465d6 AL |
48 | }; |
49 | ||
50 | class debPackagesIndex : public pkgIndexFile | |
51 | { | |
ff72bd0d MV |
52 | /** \brief dpointer placeholder (for later in case we need it) */ |
53 | void *d; | |
54 | ||
8f3ba4e8 DK |
55 | std::string URI; |
56 | std::string Dist; | |
57 | std::string Section; | |
58 | std::string Architecture; | |
7db98ffc | 59 | |
8f3ba4e8 DK |
60 | std::string Info(const char *Type) const; |
61 | std::string IndexFile(const char *Type) const; | |
62 | std::string IndexURI(const char *Type) const; | |
b2e465d6 AL |
63 | |
64 | public: | |
65 | ||
66 | virtual const Type *GetType() const; | |
67 | ||
68 | // Stuff for accessing files on remote items | |
8f3ba4e8 DK |
69 | virtual std::string ArchiveInfo(pkgCache::VerIterator Ver) const; |
70 | virtual std::string ArchiveURI(std::string File) const {return URI + File;}; | |
b2e465d6 AL |
71 | |
72 | // Interface for acquire | |
8f3ba4e8 | 73 | virtual std::string Describe(bool Short) const; |
b2e465d6 AL |
74 | |
75 | // Interface for the Cache Generator | |
76 | virtual bool Exists() const; | |
77 | virtual bool HasPackages() const {return true;}; | |
78 | virtual unsigned long Size() const; | |
2e5f4e45 | 79 | virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; |
b2e465d6 | 80 | virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; |
7db98ffc | 81 | |
8f3ba4e8 DK |
82 | debPackagesIndex(std::string const &URI, std::string const &Dist, std::string const &Section, |
83 | bool const &Trusted, std::string const &Arch = "native"); | |
ff72bd0d | 84 | virtual ~debPackagesIndex() {}; |
b2e465d6 AL |
85 | }; |
86 | ||
a52f938b OS |
87 | class debTranslationsIndex : public pkgIndexFile |
88 | { | |
ff72bd0d MV |
89 | /** \brief dpointer placeholder (for later in case we need it) */ |
90 | void *d; | |
91 | ||
8f3ba4e8 DK |
92 | std::string URI; |
93 | std::string Dist; | |
94 | std::string Section; | |
45df0ad2 | 95 | const char * const Language; |
a52f938b | 96 | |
8f3ba4e8 DK |
97 | std::string Info(const char *Type) const; |
98 | std::string IndexFile(const char *Type) const; | |
99 | std::string IndexURI(const char *Type) const; | |
a52f938b | 100 | |
8f3ba4e8 | 101 | inline std::string TranslationFile() const {return std::string("Translation-").append(Language);}; |
a52f938b OS |
102 | |
103 | public: | |
104 | ||
105 | virtual const Type *GetType() const; | |
106 | ||
107 | // Interface for acquire | |
8f3ba4e8 | 108 | virtual std::string Describe(bool Short) const; |
a52f938b OS |
109 | virtual bool GetIndexes(pkgAcquire *Owner) const; |
110 | ||
111 | // Interface for the Cache Generator | |
112 | virtual bool Exists() const; | |
11680bfd | 113 | virtual bool HasPackages() const; |
a52f938b | 114 | virtual unsigned long Size() const; |
2e5f4e45 | 115 | virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; |
c51c6f08 | 116 | virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; |
a52f938b | 117 | |
8f3ba4e8 | 118 | debTranslationsIndex(std::string URI,std::string Dist,std::string Section, char const * const Language); |
ff72bd0d | 119 | virtual ~debTranslationsIndex() {}; |
a52f938b OS |
120 | }; |
121 | ||
b2e465d6 AL |
122 | class debSourcesIndex : public pkgIndexFile |
123 | { | |
ff72bd0d MV |
124 | /** \brief dpointer placeholder (for later in case we need it) */ |
125 | void *d; | |
126 | ||
8f3ba4e8 DK |
127 | std::string URI; |
128 | std::string Dist; | |
129 | std::string Section; | |
b2e465d6 | 130 | |
8f3ba4e8 DK |
131 | std::string Info(const char *Type) const; |
132 | std::string IndexFile(const char *Type) const; | |
133 | std::string IndexURI(const char *Type) const; | |
b2e465d6 AL |
134 | |
135 | public: | |
136 | ||
137 | virtual const Type *GetType() const; | |
138 | ||
139 | // Stuff for accessing files on remote items | |
8f3ba4e8 | 140 | virtual std::string SourceInfo(pkgSrcRecords::Parser const &Record, |
b2e465d6 | 141 | pkgSrcRecords::File const &File) const; |
8f3ba4e8 | 142 | virtual std::string ArchiveURI(std::string File) const {return URI + File;}; |
b2e465d6 AL |
143 | |
144 | // Interface for acquire | |
8f3ba4e8 | 145 | virtual std::string Describe(bool Short) const; |
b2e465d6 AL |
146 | |
147 | // Interface for the record parsers | |
148 | virtual pkgSrcRecords::Parser *CreateSrcParser() const; | |
149 | ||
150 | // Interface for the Cache Generator | |
151 | virtual bool Exists() const; | |
152 | virtual bool HasPackages() const {return false;}; | |
153 | virtual unsigned long Size() const; | |
154 | ||
8f3ba4e8 | 155 | debSourcesIndex(std::string URI,std::string Dist,std::string Section,bool Trusted); |
ff72bd0d | 156 | virtual ~debSourcesIndex() {}; |
b2e465d6 AL |
157 | }; |
158 | ||
159 | #endif |