]> git.saurik.com Git - apt.git/blame - apt-pkg/deb/debmetaindex.h
store Release files data in the Cache
[apt.git] / apt-pkg / deb / debmetaindex.h
CommitLineData
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
19class pkgAcquire;
20class pkgIndexFile;
0d29b9d4 21class debDebPkgFileIndex;
80624be7 22class IndexTarget;
b07aeb1a
DK
23class pkgCacheGenerator;
24class OpProgress;
b9dadc24 25
dce45dbe 26class APT_HIDDEN debReleaseIndex : public metaIndex {
b3d44315
MV
27 public:
28
29 class debSectionEntry
30 {
31 public:
472ff00e
DK
32 debSectionEntry (std::string const &Section, bool const &IsSrc);
33 std::string const Section;
5dd4c8b8 34 bool const IsSrc;
b3d44315
MV
35 };
36
37 private:
ff72bd0d
MV
38 /** \brief dpointer placeholder (for later in case we need it) */
39 void *d;
472ff00e 40 std::map<std::string, std::vector<debSectionEntry const*> > ArchEntries;
3809194b 41 enum APT_HIDDEN { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted;
b3d44315
MV
42
43 public:
44
472ff00e
DK
45 debReleaseIndex(std::string const &URI, std::string const &Dist);
46 debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted);
ff72bd0d 47 virtual ~debReleaseIndex();
b3d44315 48
472ff00e 49 virtual std::string ArchiveURI(std::string const &File) const {return URI + File;};
5dd4c8b8 50 virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const;
261727f0 51 virtual std::vector<IndexTarget> GetIndexTargets() const;
7014e148 52
b07aeb1a
DK
53 virtual std::string Describe() const;
54 virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache) const;
55 virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const;
56
472ff00e
DK
57 std::string MetaIndexInfo(const char *Type) const;
58 std::string MetaIndexFile(const char *Types) const;
59 std::string MetaIndexURI(const char *Type) const;
7014e148 60
ccf6bdb3 61#if APT_PKG_ABI >= 413
f105aaba 62 virtual
7014e148 63#endif
f105aaba 64 std::string LocalFileName() const;
7014e148 65
472ff00e 66 virtual std::vector <pkgIndexFile *> *GetIndexFiles();
b3d44315 67
4b42f43b 68 void SetTrusted(bool const Trusted);
b3d44315
MV
69 virtual bool IsTrusted() const;
70
472ff00e
DK
71 void PushSectionEntry(std::vector<std::string> const &Archs, const debSectionEntry *Entry);
72 void PushSectionEntry(std::string const &Arch, const debSectionEntry *Entry);
b3d44315
MV
73};
74
dce45dbe 75class APT_HIDDEN debDebFileMetaIndex : public metaIndex
0d29b9d4
MV
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 }
261727f0
DK
87 virtual std::vector<IndexTarget> GetIndexTargets() const {
88 return std::vector<IndexTarget>();
89 }
0d29b9d4
MV
90 virtual std::vector<pkgIndexFile *> *GetIndexFiles() {
91 return Indexes;
92 }
93 virtual bool IsTrusted() const {
94 return true;
95 }
96 debDebFileMetaIndex(std::string const &DebFile);
97 virtual ~debDebFileMetaIndex() {};
98
99};
100
b3d44315 101#endif