summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcache.h
diff options
context:
space:
mode:
authorнаб <nabijaczleweli@nabijaczleweli.xyz>2024-11-12 17:59:18 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2025-02-14 19:45:12 +0100
commit793c9b1f3059c35b66c19f62fa39b6607809fea0 (patch)
treefe23d92be8e2f0144e5f4c8d267bd7b62e1023c1 /apt-pkg/pkgcache.h
parent6de55404ca8ce296ccf14880c6115b6d8eb4e0b9 (diff)
APT::StringView -> std::string_view [textonly]
Diffstat (limited to 'apt-pkg/pkgcache.h')
-rw-r--r--apt-pkg/pkgcache.h17
1 files changed, 8 insertions, 9 deletions
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 <ctime>
#include <string>
-#include <apt-pkg/string_view.h>
// 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;
- 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<const uint16_t*>(name - sizeof(uint16_t));
- return APT::StringView(name, len);
+ size_t len = *reinterpret_cast<const uint16_t*>(name - sizeof(uint16_t));
+ return {name, len};
}
Header &Head() {return *HeaderP;}