]>
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 | { | |
6d38011b | 25 | protected: |
b2e465d6 | 26 | string File; |
6d38011b | 27 | |
b2e465d6 AL |
28 | public: |
29 | ||
30 | virtual const Type *GetType() const; | |
31 | ||
32 | // Interface for acquire | |
af87ab54 | 33 | virtual string Describe(bool Short) const {return File;}; |
b2e465d6 AL |
34 | |
35 | // Interface for the Cache Generator | |
36 | virtual bool Exists() const; | |
37 | virtual bool HasPackages() const {return true;}; | |
38 | virtual unsigned long Size() const; | |
2e5f4e45 | 39 | virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; |
6d38011b | 40 | bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog, unsigned long const Flag) const; |
b2e465d6 AL |
41 | virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; |
42 | ||
43 | debStatusIndex(string File); | |
44 | }; | |
45 | ||
46 | class debPackagesIndex : public pkgIndexFile | |
47 | { | |
48 | string URI; | |
49 | string Dist; | |
50 | string Section; | |
5dd4c8b8 | 51 | string Architecture; |
7db98ffc | 52 | |
b2e465d6 AL |
53 | string Info(const char *Type) const; |
54 | string IndexFile(const char *Type) const; | |
7db98ffc | 55 | string IndexURI(const char *Type) const; |
b2e465d6 AL |
56 | |
57 | public: | |
58 | ||
59 | virtual const Type *GetType() const; | |
60 | ||
61 | // Stuff for accessing files on remote items | |
62 | virtual string ArchiveInfo(pkgCache::VerIterator Ver) const; | |
63 | virtual string ArchiveURI(string File) const {return URI + File;}; | |
64 | ||
65 | // Interface for acquire | |
af87ab54 | 66 | virtual string Describe(bool Short) const; |
b2e465d6 AL |
67 | |
68 | // Interface for the Cache Generator | |
69 | virtual bool Exists() const; | |
70 | virtual bool HasPackages() const {return true;}; | |
71 | virtual unsigned long Size() const; | |
2e5f4e45 | 72 | virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; |
b2e465d6 | 73 | virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; |
7db98ffc | 74 | |
5dd4c8b8 DK |
75 | debPackagesIndex(string const &URI, string const &Dist, string const &Section, |
76 | bool const &Trusted, string const &Arch = "native"); | |
b2e465d6 AL |
77 | }; |
78 | ||
a52f938b OS |
79 | class debTranslationsIndex : public pkgIndexFile |
80 | { | |
81 | string URI; | |
82 | string Dist; | |
83 | string Section; | |
45df0ad2 | 84 | const char * const Language; |
a52f938b OS |
85 | |
86 | string Info(const char *Type) const; | |
87 | string IndexFile(const char *Type) const; | |
88 | string IndexURI(const char *Type) const; | |
89 | ||
45df0ad2 | 90 | inline string TranslationFile() const {return string("Translation-").append(Language);}; |
a52f938b OS |
91 | |
92 | public: | |
93 | ||
94 | virtual const Type *GetType() const; | |
95 | ||
96 | // Interface for acquire | |
97 | virtual string Describe(bool Short) const; | |
98 | virtual bool GetIndexes(pkgAcquire *Owner) const; | |
99 | ||
100 | // Interface for the Cache Generator | |
101 | virtual bool Exists() const; | |
11680bfd | 102 | virtual bool HasPackages() const; |
a52f938b | 103 | virtual unsigned long Size() const; |
2e5f4e45 | 104 | virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; |
c51c6f08 | 105 | virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; |
a52f938b | 106 | |
45df0ad2 | 107 | debTranslationsIndex(string URI,string Dist,string Section, char const * const Language); |
a52f938b OS |
108 | }; |
109 | ||
b2e465d6 AL |
110 | class debSourcesIndex : public pkgIndexFile |
111 | { | |
112 | string URI; | |
113 | string Dist; | |
114 | string Section; | |
115 | ||
116 | string Info(const char *Type) const; | |
117 | string IndexFile(const char *Type) const; | |
7db98ffc | 118 | string IndexURI(const char *Type) const; |
b2e465d6 AL |
119 | |
120 | public: | |
121 | ||
122 | virtual const Type *GetType() const; | |
123 | ||
124 | // Stuff for accessing files on remote items | |
125 | virtual string SourceInfo(pkgSrcRecords::Parser const &Record, | |
126 | pkgSrcRecords::File const &File) const; | |
127 | virtual string ArchiveURI(string File) const {return URI + File;}; | |
128 | ||
129 | // Interface for acquire | |
af87ab54 | 130 | virtual string Describe(bool Short) const; |
b2e465d6 AL |
131 | |
132 | // Interface for the record parsers | |
133 | virtual pkgSrcRecords::Parser *CreateSrcParser() const; | |
134 | ||
135 | // Interface for the Cache Generator | |
136 | virtual bool Exists() const; | |
137 | virtual bool HasPackages() const {return false;}; | |
138 | virtual unsigned long Size() const; | |
139 | ||
7db98ffc | 140 | debSourcesIndex(string URI,string Dist,string Section,bool Trusted); |
b2e465d6 AL |
141 | }; |
142 | ||
143 | #endif |