From 793c9b1f3059c35b66c19f62fa39b6607809fea0 Mon Sep 17 00:00:00 2001 From: наб Date: Tue, 12 Nov 2024 17:59:18 +0100 Subject: APT::StringView -> std::string_view [textonly] --- apt-pkg/pkgcache.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'apt-pkg/pkgcache.h') diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index 0b61b0048..ed445b5bc 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -82,7 +82,6 @@ #include #include -#include // size of (potentially big) files like debs or the install size of them @@ -213,7 +212,7 @@ class APT_PUBLIC pkgCache /*{{{*/ // Memory mapped cache file std::string CacheFile; MMap ⤅ - map_id_t sHash(APT::StringView S) const APT_PURE; + map_id_t sHash(std::string_view S) const APT_PURE; public: @@ -239,7 +238,7 @@ class APT_PUBLIC pkgCache /*{{{*/ inline void *DataEnd() {return ((unsigned char *)Map.Data()) + Map.Size();} // String hashing function (512 range) - inline map_id_t Hash(APT::StringView S) const {return sHash(S);} + inline map_id_t Hash(std::string_view S) const {return sHash(S);} APT_HIDDEN uint32_t CacheHash(); @@ -248,15 +247,15 @@ class APT_PUBLIC pkgCache /*{{{*/ static std::string_view Priority_NoL10n(unsigned char Prio); // Accessors - GrpIterator FindGrp(APT::StringView Name); - PkgIterator FindPkg(APT::StringView Name); - PkgIterator FindPkg(APT::StringView Name, APT::StringView Arch); + GrpIterator FindGrp(std::string_view Name); + PkgIterator FindPkg(std::string_view Name); + PkgIterator FindPkg(std::string_view Name, std::string_view Arch); - APT::StringView ViewString(map_stringitem_t idx) const + std::string_view ViewString(map_stringitem_t idx) const { char *name = StrP + idx; - uint16_t len = *reinterpret_cast(name - sizeof(uint16_t)); - return APT::StringView(name, len); + size_t len = *reinterpret_cast(name - sizeof(uint16_t)); + return {name, len}; } Header &Head() {return *HeaderP;} -- cgit v1.2.3-70-g09d2