21#ifndef PKGLIB_INDEXFILE_H
22#define PKGLIB_INDEXFILE_H
24#include <apt-pkg/macros.h>
26#include <apt-pkg/pkgrecords.h>
27#include <apt-pkg/srcrecords.h>
63 std::map<std::string, std::string>
Options;
65 IndexTarget(std::string
const &MetaKey, std::string
const &ShortDesc,
66 std::string
const &LongDesc, std::string
const &
URI,
bool const IsOptional,
67 bool const KeepCompressed, std::map<std::string, std::string>
const &Options);
92 ALLOW_DOWNGRADE_TO_INSECURE,
96 std::string Option(OptionKeys
const Key)
const;
97 bool OptionBool(OptionKeys
const Key)
const;
98 std::string Format(std::string format)
const;
115 static Type **GlobalList;
116 static unsigned long GlobalListLen;
117 static Type *GetType(
const char *
const Type) APT_PURE;
121 virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator
const &)
const {
return 0;};
127 virtual const Type *GetType()
const = 0;
130 virtual std::string ArchiveInfo(pkgCache::VerIterator
const &Ver)
const;
133 virtual std::string Describe(
bool const Short =
false)
const = 0;
136 virtual std::string ArchiveURI(std::string
const &)
const {
return std::string();};
142 virtual bool Exists()
const = 0;
143 virtual bool HasPackages()
const = 0;
144 virtual unsigned long Size()
const = 0;
146 virtual pkgCache::PkgFileIterator FindInCache(
pkgCache &Cache)
const;
148 bool IsTrusted()
const {
return Trusted; };
157 virtual std::string IndexFileName()
const = 0;
158 virtual std::string GetComponent()
const = 0;
159 virtual std::string GetArchitecture()
const = 0;
160 virtual std::string GetProgressDescription()
const = 0;
161 virtual uint8_t GetIndexFlags()
const = 0;
162 virtual bool OpenListFile(
FileFd &Pkg, std::string
const &FileName) = 0;
167 pkgCache::PkgFileIterator FindInCache(
pkgCache &Cache)
const override;
179 std::string IndexFileName()
const override;
180 [[nodiscard]] std::string GetComponent()
const override;
181 [[nodiscard]] std::string GetArchitecture()
const override;
182 [[nodiscard]] std::string GetProgressDescription()
const override;
183 bool OpenListFile(
FileFd &Pkg, std::string
const &FileName)
override;
186 [[nodiscard]] std::string ArchiveURI(std::string
const &File)
const override;
187 [[nodiscard]] std::string Describe(
bool Short =
false)
const override;
188 [[nodiscard]]
bool Exists()
const override;
189 [[nodiscard]]
unsigned long Size()
const override;
202 [[nodiscard]] std::string IndexFileName()
const override;
203 [[nodiscard]] std::string GetProgressDescription()
const override;
204 bool OpenListFile(
FileFd &Pkg, std::string
const &FileName)
override;
207 [[nodiscard]] std::string Describe(
bool =
false)
const override;
208 [[nodiscard]]
bool Exists()
const override;
209 [[nodiscard]]
unsigned long Size()
const override;
210 [[nodiscard]] std::string ArchiveURI(std::string
const & )
const override;
Information about an index file.
Definition indexfile.h:39
bool IsOptional
Is it okay if the file isn't found in the meta index.
Definition indexfile.h:55
bool KeepCompressed
If the file is downloaded compressed, do not unpack it.
Definition indexfile.h:58
std::string Description
A description of the index file.
Definition indexfile.h:45
std::string ShortDesc
A shorter description of the index file.
Definition indexfile.h:48
std::map< std::string, std::string > Options
options with which this target was created Prefer the usage of Option if at all possible....
Definition indexfile.h:63
std::string URI
A URI from which the index file can be downloaded.
Definition indexfile.h:42
std::string MetaKey
The key by which this index file should be looked up within the meta index file.
Definition indexfile.h:52
Definition pkgcachegen.h:43
Definition pkgcachegen.h:178
Definition cacheiterators.h:47
Definition indexfile.h:155
Definition indexfile.h:197
Definition indexfile.h:174
Definition indexfile.h:111
Definition indexfile.h:103
Definition srcrecords.h:39
pkgCache - Structure definitions for the cache file
Definition srcrecords.h:30