]> git.saurik.com Git - apt.git/blob - apt-pkg/deb/debmetaindex.h
make all d-pointer * const pointers
[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/macros.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 #ifndef APT_10_CLEANER_HEADERS
16 #include <apt-pkg/init.h>
17 #endif
18
19 class pkgAcquire;
20 class pkgIndexFile;
21 class debDebPkgFileIndex;
22 class IndexTarget;
23 class pkgCacheGenerator;
24 class OpProgress;
25
26 class APT_HIDDEN debReleaseIndex : public metaIndex {
27 public:
28
29 class debSectionEntry
30 {
31 public:
32 debSectionEntry (std::string const &Section, bool const &IsSrc);
33 std::string const Section;
34 bool const IsSrc;
35 };
36
37 private:
38 /** \brief dpointer placeholder (for later in case we need it) */
39 void * const d;
40 std::map<std::string, std::vector<debSectionEntry const*> > ArchEntries;
41 enum APT_HIDDEN { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted;
42
43 public:
44
45 debReleaseIndex(std::string const &URI, std::string const &Dist);
46 debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted);
47 virtual ~debReleaseIndex();
48
49 virtual std::string ArchiveURI(std::string const &File) const {return URI + File;};
50 virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const;
51 virtual std::vector<IndexTarget> GetIndexTargets() const;
52
53 virtual std::string Describe() const;
54 virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool const ModifyCheck) const;
55 virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const;
56
57 std::string MetaIndexInfo(const char *Type) const;
58 std::string MetaIndexFile(const char *Types) const;
59 std::string MetaIndexURI(const char *Type) const;
60
61 #if APT_PKG_ABI >= 413
62 virtual
63 #endif
64 std::string LocalFileName() const;
65
66 virtual std::vector <pkgIndexFile *> *GetIndexFiles();
67
68 void SetTrusted(bool const Trusted);
69 virtual bool IsTrusted() const;
70
71 void PushSectionEntry(std::vector<std::string> const &Archs, const debSectionEntry *Entry);
72 void PushSectionEntry(std::string const &Arch, const debSectionEntry *Entry);
73 };
74
75 class APT_HIDDEN debDebFileMetaIndex : public metaIndex
76 {
77 private:
78 void * const d;
79 std::string DebFile;
80 debDebPkgFileIndex *DebIndex;
81 public:
82 virtual std::string ArchiveURI(std::string const& /*File*/) const {
83 return DebFile;
84 }
85 virtual bool GetIndexes(pkgAcquire* /*Owner*/, const bool& /*GetAll=false*/) const {
86 return true;
87 }
88 virtual std::vector<IndexTarget> GetIndexTargets() const {
89 return std::vector<IndexTarget>();
90 }
91 virtual std::vector<pkgIndexFile *> *GetIndexFiles() {
92 return Indexes;
93 }
94 virtual bool IsTrusted() const {
95 return true;
96 }
97 debDebFileMetaIndex(std::string const &DebFile);
98 virtual ~debDebFileMetaIndex();
99
100 };
101
102 #endif