]>
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; | |
b9dadc24 | 21 | |
b3d44315 MV |
22 | class debReleaseIndex : public metaIndex { |
23 | public: | |
24 | ||
25 | class debSectionEntry | |
26 | { | |
27 | public: | |
472ff00e DK |
28 | debSectionEntry (std::string const &Section, bool const &IsSrc); |
29 | std::string const Section; | |
5dd4c8b8 | 30 | bool const IsSrc; |
b3d44315 MV |
31 | }; |
32 | ||
33 | private: | |
ff72bd0d MV |
34 | /** \brief dpointer placeholder (for later in case we need it) */ |
35 | void *d; | |
472ff00e | 36 | std::map<std::string, std::vector<debSectionEntry const*> > ArchEntries; |
4b42f43b | 37 | enum { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted; |
b3d44315 MV |
38 | |
39 | public: | |
40 | ||
472ff00e DK |
41 | debReleaseIndex(std::string const &URI, std::string const &Dist); |
42 | debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted); | |
ff72bd0d | 43 | virtual ~debReleaseIndex(); |
b3d44315 | 44 | |
472ff00e | 45 | virtual std::string ArchiveURI(std::string const &File) const {return URI + File;}; |
5dd4c8b8 | 46 | virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const; |
472ff00e DK |
47 | std::vector <struct IndexTarget *>* ComputeIndexTargets() const; |
48 | std::string Info(const char *Type, std::string const &Section, std::string const &Arch="") const; | |
7014e148 | 49 | |
472ff00e DK |
50 | std::string MetaIndexInfo(const char *Type) const; |
51 | std::string MetaIndexFile(const char *Types) const; | |
52 | std::string MetaIndexURI(const char *Type) const; | |
7014e148 MV |
53 | |
54 | #if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13) | |
55 | virtual std::string LocalFileName() const; | |
56 | #endif | |
57 | ||
472ff00e DK |
58 | std::string IndexURI(const char *Type, std::string const &Section, std::string const &Arch="native") const; |
59 | std::string IndexURISuffix(const char *Type, std::string const &Section, std::string const &Arch="native") const; | |
60 | std::string SourceIndexURI(const char *Type, const std::string &Section) const; | |
61 | std::string SourceIndexURISuffix(const char *Type, const std::string &Section) const; | |
62 | std::string TranslationIndexURI(const char *Type, const std::string &Section) const; | |
63 | std::string TranslationIndexURISuffix(const char *Type, const std::string &Section) const; | |
64 | virtual std::vector <pkgIndexFile *> *GetIndexFiles(); | |
b3d44315 | 65 | |
4b42f43b | 66 | void SetTrusted(bool const Trusted); |
b3d44315 MV |
67 | virtual bool IsTrusted() const; |
68 | ||
472ff00e DK |
69 | void PushSectionEntry(std::vector<std::string> const &Archs, const debSectionEntry *Entry); |
70 | void PushSectionEntry(std::string const &Arch, const debSectionEntry *Entry); | |
b3d44315 MV |
71 | void PushSectionEntry(const debSectionEntry *Entry); |
72 | }; | |
73 | ||
74 | #endif |