]>
Commit | Line | Data |
---|---|---|
b3d44315 MV |
1 | // ijones, walters |
2 | #ifndef PKGLIB_DEBMETAINDEX_H | |
3 | #define PKGLIB_DEBMETAINDEX_H | |
4 | ||
b3d44315 | 5 | #include <apt-pkg/metaindex.h> |
453b82a3 | 6 | #include <apt-pkg/macros.h> |
b3d44315 | 7 | |
5dd4c8b8 | 8 | #include <map> |
472ff00e DK |
9 | #include <string> |
10 | #include <vector> | |
5dd4c8b8 | 11 | |
b9dadc24 DK |
12 | #ifndef APT_8_CLEANER_HEADERS |
13 | #include <apt-pkg/sourcelist.h> | |
14 | #endif | |
453b82a3 DK |
15 | #ifndef APT_10_CLEANER_HEADERS |
16 | #include <apt-pkg/init.h> | |
17 | #endif | |
18 | ||
19 | class pkgAcquire; | |
20 | class pkgIndexFile; | |
0d29b9d4 | 21 | class debDebPkgFileIndex; |
b9dadc24 | 22 | |
b3d44315 MV |
23 | class debReleaseIndex : public metaIndex { |
24 | public: | |
25 | ||
26 | class debSectionEntry | |
27 | { | |
28 | public: | |
472ff00e DK |
29 | debSectionEntry (std::string const &Section, bool const &IsSrc); |
30 | std::string const Section; | |
5dd4c8b8 | 31 | bool const IsSrc; |
b3d44315 MV |
32 | }; |
33 | ||
34 | private: | |
ff72bd0d MV |
35 | /** \brief dpointer placeholder (for later in case we need it) */ |
36 | void *d; | |
472ff00e | 37 | std::map<std::string, std::vector<debSectionEntry const*> > ArchEntries; |
4b42f43b | 38 | enum { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted; |
b3d44315 MV |
39 | |
40 | public: | |
41 | ||
472ff00e DK |
42 | debReleaseIndex(std::string const &URI, std::string const &Dist); |
43 | debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted); | |
ff72bd0d | 44 | virtual ~debReleaseIndex(); |
b3d44315 | 45 | |
472ff00e | 46 | virtual std::string ArchiveURI(std::string const &File) const {return URI + File;}; |
5dd4c8b8 | 47 | virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const; |
472ff00e DK |
48 | std::vector <struct IndexTarget *>* ComputeIndexTargets() const; |
49 | std::string Info(const char *Type, std::string const &Section, std::string const &Arch="") const; | |
7014e148 | 50 | |
472ff00e DK |
51 | std::string MetaIndexInfo(const char *Type) const; |
52 | std::string MetaIndexFile(const char *Types) const; | |
53 | std::string MetaIndexURI(const char *Type) const; | |
7014e148 MV |
54 | |
55 | #if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13) | |
56 | virtual std::string LocalFileName() const; | |
57 | #endif | |
58 | ||
472ff00e DK |
59 | std::string IndexURI(const char *Type, std::string const &Section, std::string const &Arch="native") const; |
60 | std::string IndexURISuffix(const char *Type, std::string const &Section, std::string const &Arch="native") const; | |
61 | std::string SourceIndexURI(const char *Type, const std::string &Section) const; | |
62 | std::string SourceIndexURISuffix(const char *Type, const std::string &Section) const; | |
63 | std::string TranslationIndexURI(const char *Type, const std::string &Section) const; | |
64 | std::string TranslationIndexURISuffix(const char *Type, const std::string &Section) const; | |
65 | virtual std::vector <pkgIndexFile *> *GetIndexFiles(); | |
b3d44315 | 66 | |
4b42f43b | 67 | void SetTrusted(bool const Trusted); |
b3d44315 MV |
68 | virtual bool IsTrusted() const; |
69 | ||
472ff00e DK |
70 | void PushSectionEntry(std::vector<std::string> const &Archs, const debSectionEntry *Entry); |
71 | void PushSectionEntry(std::string const &Arch, const debSectionEntry *Entry); | |
b3d44315 MV |
72 | void PushSectionEntry(const debSectionEntry *Entry); |
73 | }; | |
74 | ||
0d29b9d4 MV |
75 | class debDebFileMetaIndex : public metaIndex |
76 | { | |
77 | private: | |
78 | std::string DebFile; | |
79 | debDebPkgFileIndex *DebIndex; | |
80 | public: | |
81 | virtual std::string ArchiveURI(std::string const& /*File*/) const { | |
82 | return DebFile; | |
83 | } | |
84 | virtual bool GetIndexes(pkgAcquire* /*Owner*/, const bool& /*GetAll=false*/) const { | |
85 | return true; | |
86 | } | |
87 | virtual std::vector<pkgIndexFile *> *GetIndexFiles() { | |
88 | return Indexes; | |
89 | } | |
90 | virtual bool IsTrusted() const { | |
91 | return true; | |
92 | } | |
93 | debDebFileMetaIndex(std::string const &DebFile); | |
94 | virtual ~debDebFileMetaIndex() {}; | |
95 | ||
96 | }; | |
97 | ||
b3d44315 | 98 | #endif |