]> git.saurik.com Git - apt.git/blob - apt-pkg/deb/debmetaindex.h
bba0e344f87fd3b6576874ba886d230eeebabaf8
[apt.git] / apt-pkg / deb / debmetaindex.h
1 #ifndef PKGLIB_DEBMETAINDEX_H
2 #define PKGLIB_DEBMETAINDEX_H
3
4 #include <apt-pkg/metaindex.h>
5 #include <apt-pkg/macros.h>
6
7 #include <map>
8 #include <string>
9 #include <vector>
10
11 #ifndef APT_8_CLEANER_HEADERS
12 #include <apt-pkg/sourcelist.h>
13 #endif
14 #ifndef APT_10_CLEANER_HEADERS
15 #include <apt-pkg/init.h>
16 #endif
17
18 class pkgAcquire;
19 class pkgIndexFile;
20 class IndexTarget;
21 class pkgCacheGenerator;
22 class OpProgress;
23 class debReleaseIndexPrivate;
24
25 class APT_HIDDEN debReleaseIndex : public metaIndex
26 {
27 debReleaseIndexPrivate * const d;
28
29 APT_HIDDEN bool parseSumData(const char *&Start, const char *End, std::string &Name,
30 std::string &Hash, unsigned long long &Size);
31 public:
32
33 APT_HIDDEN std::string MetaIndexInfo(const char *Type) const;
34 APT_HIDDEN std::string MetaIndexFile(const char *Types) const;
35 APT_HIDDEN std::string MetaIndexURI(const char *Type) const;
36
37 debReleaseIndex(std::string const &URI, std::string const &Dist);
38 debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted);
39 virtual ~debReleaseIndex();
40
41 virtual std::string ArchiveURI(std::string const &File) const APT_OVERRIDE {return URI + File;};
42 virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) APT_OVERRIDE;
43 virtual std::vector<IndexTarget> GetIndexTargets() const APT_OVERRIDE;
44
45 virtual std::string Describe() const APT_OVERRIDE;
46 virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool const ModifyCheck) const APT_OVERRIDE;
47 virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE;
48
49 virtual bool Load(std::string const &Filename, std::string * const ErrorText) APT_OVERRIDE;
50 virtual metaIndex * UnloadedClone() const APT_OVERRIDE;
51
52 virtual std::vector <pkgIndexFile *> *GetIndexFiles() APT_OVERRIDE;
53
54 bool SetTrusted(TriState const Trusted);
55 bool SetCheckValidUntil(TriState const Trusted);
56 bool SetValidUntilMin(time_t const Valid);
57 bool SetValidUntilMax(time_t const Valid);
58 bool SetSignedBy(std::string const &SignedBy);
59
60 virtual bool IsTrusted() const APT_OVERRIDE;
61
62 void AddComponent(bool const isSrc, std::string const &Name,
63 std::vector<std::string> const &Targets,
64 std::vector<std::string> const &Architectures,
65 std::vector<std::string> Languages,
66 bool const usePDiffs);
67 };
68
69 #endif