apt 3.1.11 commandline package manager

debmetaindex.h
1#ifndef PKGLIB_DEBMETAINDEX_H
2#define PKGLIB_DEBMETAINDEX_H
3
4#include <apt-pkg/macros.h>
5#include <apt-pkg/metaindex.h>
6
7#include <map>
8#include <optional>
9#include <string>
10#include <vector>
11
12
13 class pkgAcquire;
14 class pkgIndexFile;
15 class IndexTarget;
16 class pkgCacheGenerator;
17 class OpProgress;
18 class debReleaseIndexPrivate;
19
20 class APT_HIDDEN debReleaseIndex : public metaIndex
21{
22 debReleaseIndexPrivate * const d;
23
24 APT_HIDDEN bool parseSumData(const char *&Start, const char *End, std::string &Name,
25 std::string &Hash, unsigned long long &Size);
26 public:
27
28 APT_HIDDEN std::string MetaIndexInfo(const char *Type) const;
29 APT_HIDDEN std::string MetaIndexFile(const char *Types) const;
30 APT_HIDDEN std::string MetaIndexURI(const char *Type) const;
31
32 debReleaseIndex(std::string const &URI, std::string const &Dist, std::map<std::string,std::string> const &Options);
33 debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted, std::map<std::string,std::string> const &Options);
34 ~debReleaseIndex() override;
35
36 [[nodiscard]] std::string ArchiveURI(std::string const &File) const override;
37 bool GetIndexes(pkgAcquire *Owner, bool const &GetAll = false) override;
38 [[nodiscard]] std::vector<IndexTarget> GetIndexTargets() const override;
39
40 [[nodiscard]] std::string Describe() const override;
41 pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool ModifyCheck) const override;
42 bool Merge(pkgCacheGenerator &Gen, OpProgress *Prog) const override;
43
44 bool Load(std::string const &Filename, std::string *ErrorText) override;
45 [[nodiscard]] metaIndex *UnloadedClone() const override;
46
47 std::vector<pkgIndexFile *> *GetIndexFiles() override;
48
49 bool SetTrusted(TriState const Trusted);
50 bool SetCheckValidUntil(TriState const Trusted);
51 bool SetValidUntilMin(time_t const Valid);
52 bool SetValidUntilMax(time_t const Valid);
53 bool SetCheckDate(TriState const CheckDate);
54 bool SetDateMaxFuture(time_t const DateMaxFuture);
55 bool SetSnapshot(std::string Snapshot);
56 std::string GetSnapshotsServer() const; // As defined in the Release file
57 bool SetSignedBy(std::string const &SignedBy);
58 std::map<std::string, std::string> GetReleaseOptions();
59
60 [[nodiscard]] bool IsTrusted() const override;
61 [[nodiscard]] bool IsArchitectureSupported(std::string const &arch) const override;
62 [[nodiscard]] bool IsArchitectureAllSupportedFor(IndexTarget const &target) const override;
63 [[nodiscard]] bool HasSupportForComponent(std::string const &component) const override;
64
65 [[nodiscard]] time_t GetNotBefore() const override APT_PURE;
66
67 bool AddComponent(std::string const &sourcesEntry,
68 bool const isSrc, std::string const &Name,
69 std::vector<std::string> const &Targets,
70 std::vector<std::string> const &Architectures,
71 std::vector<std::string> Languages,
72 bool const usePDiffs, std::string const &useByHash,
73 std::optional<std::vector<std::string>> const &include,
74 std::optional<std::vector<std::string>> const &exclude);
75};
76
77#endif
IndexTarget
Information about an index file.
Definition indexfile.h:39
OpProgress
Definition progress.h:30
debReleaseIndexPrivate
Definition debmetaindex.cc:103
debReleaseIndex::Load
bool Load(std::string const &Filename, std::string *ErrorText) override
Definition debmetaindex.cc:474
metaIndex::UnloadedClone
virtual metaIndex * UnloadedClone() const =0
pkgAcquire
The core download scheduler. {{{.
Definition acquire.h:94
pkgCacheGenerator
Definition pkgcachegen.h:44
pkgCache::RlsFileIterator
Definition cacheiterators.h:467
pkgCache
Definition pkgcache.h:126
pkgIndexFile
Definition indexfile.h:103