]>
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; |
80624be7 | 22 | class IndexTarget; |
b9dadc24 | 23 | |
dce45dbe | 24 | class APT_HIDDEN debReleaseIndex : public metaIndex { |
b3d44315 MV |
25 | public: |
26 | ||
27 | class debSectionEntry | |
28 | { | |
29 | public: | |
472ff00e DK |
30 | debSectionEntry (std::string const &Section, bool const &IsSrc); |
31 | std::string const Section; | |
5dd4c8b8 | 32 | bool const IsSrc; |
b3d44315 MV |
33 | }; |
34 | ||
35 | private: | |
ff72bd0d MV |
36 | /** \brief dpointer placeholder (for later in case we need it) */ |
37 | void *d; | |
472ff00e | 38 | std::map<std::string, std::vector<debSectionEntry const*> > ArchEntries; |
3809194b | 39 | enum APT_HIDDEN { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted; |
b3d44315 MV |
40 | |
41 | public: | |
42 | ||
472ff00e DK |
43 | debReleaseIndex(std::string const &URI, std::string const &Dist); |
44 | debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted); | |
ff72bd0d | 45 | virtual ~debReleaseIndex(); |
b3d44315 | 46 | |
472ff00e | 47 | virtual std::string ArchiveURI(std::string const &File) const {return URI + File;}; |
5dd4c8b8 | 48 | virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const; |
80624be7 | 49 | std::vector <IndexTarget *>* ComputeIndexTargets() const; |
472ff00e | 50 | std::string Info(const char *Type, std::string const &Section, std::string const &Arch="") const; |
7014e148 | 51 | |
472ff00e DK |
52 | std::string MetaIndexInfo(const char *Type) const; |
53 | std::string MetaIndexFile(const char *Types) const; | |
54 | std::string MetaIndexURI(const char *Type) const; | |
7014e148 | 55 | |
ccf6bdb3 | 56 | #if APT_PKG_ABI >= 413 |
f105aaba | 57 | virtual |
7014e148 | 58 | #endif |
f105aaba | 59 | std::string LocalFileName() const; |
7014e148 | 60 | |
472ff00e DK |
61 | std::string IndexURI(const char *Type, std::string const &Section, std::string const &Arch="native") const; |
62 | std::string IndexURISuffix(const char *Type, std::string const &Section, std::string const &Arch="native") const; | |
63 | std::string SourceIndexURI(const char *Type, const std::string &Section) const; | |
64 | std::string SourceIndexURISuffix(const char *Type, const std::string &Section) const; | |
65 | std::string TranslationIndexURI(const char *Type, const std::string &Section) const; | |
66 | std::string TranslationIndexURISuffix(const char *Type, const std::string &Section) const; | |
67 | virtual std::vector <pkgIndexFile *> *GetIndexFiles(); | |
b3d44315 | 68 | |
4b42f43b | 69 | void SetTrusted(bool const Trusted); |
b3d44315 MV |
70 | virtual bool IsTrusted() const; |
71 | ||
472ff00e DK |
72 | void PushSectionEntry(std::vector<std::string> const &Archs, const debSectionEntry *Entry); |
73 | void PushSectionEntry(std::string const &Arch, const debSectionEntry *Entry); | |
b3d44315 MV |
74 | void PushSectionEntry(const debSectionEntry *Entry); |
75 | }; | |
76 | ||
dce45dbe | 77 | class APT_HIDDEN debDebFileMetaIndex : public metaIndex |
0d29b9d4 MV |
78 | { |
79 | private: | |
80 | std::string DebFile; | |
81 | debDebPkgFileIndex *DebIndex; | |
82 | public: | |
83 | virtual std::string ArchiveURI(std::string const& /*File*/) const { | |
84 | return DebFile; | |
85 | } | |
86 | virtual bool GetIndexes(pkgAcquire* /*Owner*/, const bool& /*GetAll=false*/) const { | |
87 | return true; | |
88 | } | |
89 | virtual std::vector<pkgIndexFile *> *GetIndexFiles() { | |
90 | return Indexes; | |
91 | } | |
92 | virtual bool IsTrusted() const { | |
93 | return true; | |
94 | } | |
95 | debDebFileMetaIndex(std::string const &DebFile); | |
96 | virtual ~debDebFileMetaIndex() {}; | |
97 | ||
98 | }; | |
99 | ||
b3d44315 | 100 | #endif |