44 APT_HIDDEN
map_stringitem_t WriteStringInMap(std::string_view String) {
return WriteStringInMap(String.data(), String.size()); };
46 APT_HIDDEN
map_stringitem_t WriteStringInMap(
const char *String,
const unsigned long &Len);
47 APT_HIDDEN uint32_t AllocateInMap(
const unsigned long &size);
53#if __cplusplus >= 201103L && defined(APT_COMPILING_APT)
54 struct string_pointer {
60 const char *data()
const {
61 return data_ !=
nullptr ? data_ :
static_cast<char*
>(generator->Map.Data()) + item;
64 bool operator ==(string_pointer
const &other)
const {
65 return size == other.size && memcmp(data(), other.data(), size) == 0;
69 uint32_t operator()(string_pointer
const &that)
const {
70 return XXH3_64bits(that.data(), that.size) & 0xFFFFFFFF;
74 std::unordered_set<string_pointer, hash> strMixed;
75 std::unordered_set<string_pointer, hash> strVersions;
76 std::unordered_set<string_pointer, hash> strSections;
83 std::vector<VersionExtra> VersionExtra;
92 static std::vector<Iter*> toReMap;
94 toReMap.push_back(&I);
101#if __cplusplus >= 201103L
103 void operator=(
const Dynamic&) =
delete;
113 std::string RlsFileName;
115 std::string PkgFileName;
118 bool NewGroup(pkgCache::GrpIterator &Grp, std::string_view Name);
119 bool NewPackage(pkgCache::PkgIterator &Pkg, std::string_view Name, std::string_view Arch);
124 bool NewFileVer(pkgCache::VerIterator &Ver,
ListParser &List);
125 bool NewFileDesc(pkgCache::DescIterator &Desc,
ListParser &List);
126 bool NewDepends(pkgCache::PkgIterator &Pkg, pkgCache::VerIterator &Ver,
129 bool NewProvides(pkgCache::VerIterator &Ver, pkgCache::PkgIterator &Pkg,
134 enum StringType { MIXED, VERSIONNUMBER, SECTION };
135 map_stringitem_t StoreString(StringType
const type,
const char * S,
unsigned int const Size);
137 inline map_stringitem_t StoreString(
enum StringType
const type, std::string_view S) {
return StoreString(type, S.data(),S.length());};
139 void DropProgress() {Progress = 0;};
140 bool SelectFile(
const std::string &File,
pkgIndexFile const &Index, std::string
const &Architecture, std::string
const &Component,
unsigned long Flags = 0);
141 bool SelectReleaseFile(
const std::string &File,
const std::string &Site,
unsigned long Flags = 0);
142 bool MergeList(ListParser &List,pkgCache::VerIterator *Ver = 0);
143 inline pkgCache &GetCache() {
return Cache;};
144 inline pkgCache::PkgFileIterator GetCurFile()
145 {
return pkgCache::PkgFileIterator(Cache,CurrentFile);};
146 inline pkgCache::RlsFileIterator GetCurRlsFile()
147 {
return pkgCache::RlsFileIterator(Cache,CurrentRlsFile);};
150 MMap **OutMap = 0,
bool AllowMem =
false);
152 MMap **OutMap,
pkgCache **OutCache,
bool AllowMem =
false);
155 void ReMap(
void const *
const oldMap,
void *
const newMap,
size_t oldSize);
163 APT_HIDDEN
bool MergeListGroup(ListParser &List, std::string
const &GrpName);
164 APT_HIDDEN
bool MergeListPackage(ListParser &List, pkgCache::PkgIterator &Pkg);
165 APT_HIDDEN
bool MergeListVersion(ListParser &List, pkgCache::PkgIterator &Pkg,
166 std::string_view Version, pkgCache::VerIterator* &OutVer);
168 APT_HIDDEN
bool AddImplicitDepends(pkgCache::GrpIterator &G, pkgCache::PkgIterator &P,
169 pkgCache::VerIterator &V);
170 APT_HIDDEN
bool AddImplicitDepends(pkgCache::VerIterator &V, pkgCache::PkgIterator &D);
172 APT_HIDDEN
bool AddNewDescription(ListParser &List, pkgCache::VerIterator &Ver,
173 std::string
const &lang, std::string_view CurMd5,
map_stringitem_t &md5idx);
183 pkgCache::VerIterator OldDepVer;
189 inline bool NewGroup(pkgCache::GrpIterator &Grp, std::string_view Name) {
return Owner->NewGroup(Grp, Name); }
190 inline map_stringitem_t StoreString(pkgCacheGenerator::StringType
const type,
const char *S,
unsigned int Size) {
return Owner->StoreString(type, S, Size);};
191 inline map_stringitem_t StoreString(pkgCacheGenerator::StringType
const type, std::string_view S) {
return Owner->StoreString(type, S);};
192 inline map_stringitem_t WriteString(std::string_view S) {
return Owner->WriteStringInMap(S.data(), S.size());};
194 inline map_stringitem_t WriteString(
const char *S,
unsigned int Size) {
return Owner->WriteStringInMap(S,Size);};
195 bool NewDepends(pkgCache::VerIterator &Ver,std::string_view Package, std::string_view Arch,
196 std::string_view Version,uint8_t
const Op,
198 bool NewProvides(pkgCache::VerIterator &Ver,std::string_view PkgName,
199 std::string_view PkgArch, std::string_view Version,
200 uint8_t
const Flags);
201 bool NewProvidesAllArch(pkgCache::VerIterator &Ver, std::string_view Package,
202 std::string_view Version, uint8_t
const Flags);
206 virtual std::string Package() = 0;
207 virtual bool ArchitectureAll() = 0;
208 virtual std::string_view Architecture() = 0;
209 virtual std::string_view Version() = 0;
210 virtual bool NewVersion(pkgCache::VerIterator &Ver) = 0;
211 virtual std::vector<std::string> AvailableDescriptionLanguages() = 0;
212 virtual std::string_view Description_md5() = 0;
213 virtual uint32_t VersionHash() = 0;
219 virtual bool SameVersion(uint32_t Hash, pkgCache::VerIterator
const &Ver);
220 virtual bool UsePackage(pkgCache::PkgIterator &Pkg,
221 pkgCache::VerIterator &Ver) = 0;
222 virtual map_filesize_t Offset() = 0;
223 virtual map_filesize_t Size() = 0;
225 virtual bool Step() = 0;
227 virtual bool CollectFileProvides(
pkgCache &,
228 pkgCache::VerIterator &) {
return true;};