]> git.saurik.com Git - apt.git/blob - apt-pkg/deb/debmetaindex.h
fc0b7f948f005e342aa92f554bff992f843597c3
[apt.git] / apt-pkg / deb / debmetaindex.h
1 // ijones, walters
2 #ifndef PKGLIB_DEBMETAINDEX_H
3 #define PKGLIB_DEBMETAINDEX_H
4
5 #include <apt-pkg/metaindex.h>
6 #include <apt-pkg/init.h>
7
8 #include <map>
9 #include <string>
10 #include <vector>
11
12 #ifndef APT_8_CLEANER_HEADERS
13 #include <apt-pkg/sourcelist.h>
14 #endif
15
16 class debReleaseIndex : public metaIndex {
17 public:
18
19 class debSectionEntry
20 {
21 public:
22 debSectionEntry (std::string const &Section, bool const &IsSrc);
23 std::string const Section;
24 bool const IsSrc;
25 };
26
27 private:
28 /** \brief dpointer placeholder (for later in case we need it) */
29 void *d;
30 std::map<std::string, std::vector<debSectionEntry const*> > ArchEntries;
31 enum { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted;
32
33 public:
34
35 debReleaseIndex(std::string const &URI, std::string const &Dist);
36 debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted);
37 virtual ~debReleaseIndex();
38
39 virtual std::string ArchiveURI(std::string const &File) const {return URI + File;};
40 virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const;
41 std::vector <struct IndexTarget *>* ComputeIndexTargets() const;
42 std::string Info(const char *Type, std::string const &Section, std::string const &Arch="") const;
43
44 #if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR < 13)
45 std::string MetaIndexInfo(const char *Type) const;
46 std::string MetaIndexFile(const char *Types) const;
47 std::string MetaIndexURI(const char *Type) const;
48 #endif
49
50 std::string IndexURI(const char *Type, std::string const &Section, std::string const &Arch="native") const;
51 std::string IndexURISuffix(const char *Type, std::string const &Section, std::string const &Arch="native") const;
52 std::string SourceIndexURI(const char *Type, const std::string &Section) const;
53 std::string SourceIndexURISuffix(const char *Type, const std::string &Section) const;
54 std::string TranslationIndexURI(const char *Type, const std::string &Section) const;
55 std::string TranslationIndexURISuffix(const char *Type, const std::string &Section) const;
56 virtual std::vector <pkgIndexFile *> *GetIndexFiles();
57
58 void SetTrusted(bool const Trusted);
59 virtual bool IsTrusted() const;
60
61 void PushSectionEntry(std::vector<std::string> const &Archs, const debSectionEntry *Entry);
62 void PushSectionEntry(std::string const &Arch, const debSectionEntry *Entry);
63 void PushSectionEntry(const debSectionEntry *Entry);
64 };
65
66 #endif