apt 3.0.3
commandline package manager
debindexfile.h
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
3/* ######################################################################
4
5 Debian Index Files
6
7 There are three sorts currently
8
9 Package files that have File: tags
10 Package files that don't (/var/lib/dpkg/status)
11 Source files
12
13 ##################################################################### */
14 /*}}}*/
15#ifndef PKGLIB_DEBINDEXFILE_H
16#define PKGLIB_DEBINDEXFILE_H
17
18#include <apt-pkg/indexfile.h>
19#include <apt-pkg/pkgcache.h>
20#include <apt-pkg/srcrecords.h>
21
22#include <string>
23
24class OpProgress;
25class pkgAcquire;
27
29{
30 void * const d;
31protected:
32 [[nodiscard]] std::string GetArchitecture() const override;
33 [[nodiscard]] std::string GetComponent() const override;
34 [[nodiscard]] uint8_t GetIndexFlags() const override;
35
36public:
37
38 [[nodiscard]] const Type *GetType() const override APT_PURE;
39
40 // Interface for the Cache Generator
41 [[nodiscard]] bool HasPackages() const override { return true; };
42 // Abort if the file does not exist.
43 [[nodiscard]] bool Exists() const override { return true; };
44
45 pkgCacheListParser *CreateListParser(FileFd &Pkg) override;
46
47 explicit debStatusIndex(std::string const &File);
48 ~debStatusIndex() override;
49};
50
52{
53 void * const d;
54protected:
55 [[nodiscard]] uint8_t GetIndexFlags() const override;
56
57public:
58 [[nodiscard]] const Type *GetType() const override APT_PURE;
59
60 // Stuff for accessing files on remote items
61 [[nodiscard]] std::string ArchiveInfo(pkgCache::VerIterator const &Ver) const override;
62
63 // Interface for the Cache Generator
64 [[nodiscard]] bool HasPackages() const override {return true;};
65
66 debPackagesIndex(IndexTarget const &Target, bool const Trusted);
67 ~debPackagesIndex() override;
68};
69
71{
72 void * const d;
73protected:
74 [[nodiscard]] std::string GetArchitecture() const override;
75 [[nodiscard]] uint8_t GetIndexFlags() const override;
76 bool OpenListFile(FileFd &Pkg, std::string const &FileName) override;
77 APT_HIDDEN pkgCacheListParser *CreateListParser(FileFd &Pkg) override;
78
79public:
80 [[nodiscard]] const Type *GetType() const override APT_PURE;
81
82 // Interface for the Cache Generator
83 [[nodiscard]] bool HasPackages() const override;
84
85 explicit debTranslationsIndex(IndexTarget const &Target);
86 ~debTranslationsIndex() override;
87};
88
90{
91 void * const d;
92 [[nodiscard]] uint8_t GetIndexFlags() const override;
93 bool OpenListFile(FileFd &Pkg, std::string const &FileName) override;
94 APT_HIDDEN pkgCacheListParser *CreateListParser(FileFd &Pkg) override;
95
96public:
97 [[nodiscard]] const Type *GetType() const override APT_PURE;
98
99 // Stuff for accessing files on remote items
100 [[nodiscard]] std::string SourceInfo(pkgSrcRecords::Parser const &Record,
101 pkgSrcRecords::File const &File) const override;
102
103 // Interface for the record parsers
104 [[nodiscard]] pkgSrcRecords::Parser *CreateSrcParser() const override;
105
106 // Interface for the Cache Generator
107 [[nodiscard]] bool HasPackages() const override { return false; };
108
109 debSourcesIndex(IndexTarget const &Target, bool const Trusted);
110 ~debSourcesIndex() override;
111};
112
114{
115 void * const d;
116 std::string DebFile;
117
118protected:
119 [[nodiscard]] std::string GetComponent() const override;
120 [[nodiscard]] std::string GetArchitecture() const override;
121 [[nodiscard]] uint8_t GetIndexFlags() const override;
122 bool OpenListFile(FileFd &Pkg, std::string const &FileName) override;
123 APT_HIDDEN pkgCacheListParser *CreateListParser(FileFd &Pkg) override;
124
125public:
126 [[nodiscard]] const Type *GetType() const override APT_PURE;
127
134 static bool GetContent(std::ostream &content, std::string const &debfile);
135
136 // Interface for the Cache Generator
137 [[nodiscard]] bool HasPackages() const override { return true; }
138 pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const override;
139
140 // Interface for acquire
141
142 explicit debDebPkgFileIndex(std::string const &DebFile);
143 ~debDebPkgFileIndex() override;
144
145 [[nodiscard]] std::string ArchiveInfo(pkgCache::VerIterator const &Ver) const override;
146};
147
149{
150 void * const d;
151
152protected:
153 [[nodiscard]] std::string GetComponent() const override;
154 [[nodiscard]] std::string GetArchitecture() const override;
155 [[nodiscard]] uint8_t GetIndexFlags() const override;
156
157public:
158 [[nodiscard]] const Type *GetType() const override APT_PURE;
159 [[nodiscard]] pkgSrcRecords::Parser *CreateSrcParser() const override;
160 [[nodiscard]] bool HasPackages() const override { return false; };
161
162 explicit debDscFileIndex(std::string const &DscFile);
163 virtual ~debDscFileIndex();
164};
165
167{
168protected:
169 [[nodiscard]] std::string GetComponent() const override;
170
171public:
172[[nodiscard]] const Type *GetType() const override APT_PURE;
173};
174
176{
177 void * const d;
178protected:
179 [[nodiscard]] std::string GetArchitecture() const override;
180 [[nodiscard]] std::string GetComponent() const override;
181 [[nodiscard]] uint8_t GetIndexFlags() const override;
182
183 public:
184 [[nodiscard]] const Type *GetType() const override APT_PURE;
185
186 // Interface for the Cache Generator
187 [[nodiscard]] bool HasPackages() const override { return true; };
188 // Abort if the file does not exist.
189 [[nodiscard]] bool Exists() const override { return true; };
190
191 explicit debStringPackageIndex(std::string const &content);
192 ~debStringPackageIndex() override;
193};
194#endif
Definition fileutl.h:43
Information about an index file.
Definition indexfile.h:39
Definition progress.h:30
Definition debindexfile.h:114
static bool GetContent(std::ostream &content, std::string const &debfile)
Definition debindexfile.cc:174
Definition debindexfile.h:167
Definition debindexfile.h:149
Definition debindexfile.h:52
Definition debindexfile.h:90
Definition debindexfile.h:29
Definition debindexfile.h:176
Definition debindexfile.h:71
Represents the process by which a pkgAcquire object should retrieve a file or a collection of files.
Definition acquire-item.h:59
Definition pkgcachegen.h:43
Definition pkgcachegen.h:178
Definition cacheiterators.h:47
Definition indexfile.h:197
Definition indexfile.h:174
Definition indexfile.h:111
Definition srcrecords.h:39
pkgCache - Structure definitions for the cache file
Definition srcrecords.h:30