diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2019-02-04 19:50:16 +0100 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2019-06-11 14:45:55 +0200 |
commit | a6e86d51a0e32cdc91f2902b0d6b483af884dcca (patch) | |
tree | 528867efd4499d088a7204470b0ff10bdb87457f /apt-pkg/pkgcache.h | |
parent | 93e0ba2bfde58e6c1fbad53614083be8754d7ee8 (diff) |
Make APT::StringView public
Diffstat (limited to 'apt-pkg/pkgcache.h')
-rw-r--r-- | apt-pkg/pkgcache.h | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index c20320a56..4511aade0 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -81,9 +81,7 @@ #include <stdint.h> #include <time.h> -#ifdef APT_PKG_EXPOSE_STRING_VIEW #include <apt-pkg/string_view.h> -#endif #ifndef APT_8_CLEANER_HEADERS using std::string; @@ -199,11 +197,7 @@ class pkgCache /*{{{*/ // Memory mapped cache file std::string CacheFile; MMap ⤅ -#ifdef APT_PKG_EXPOSE_STRING_VIEW - APT_HIDDEN map_id_t sHash(APT::StringView S) const APT_PURE; -#endif - map_id_t sHash(const std::string &S) const APT_PURE; - map_id_t sHash(const char *S) const APT_PURE; + map_id_t sHash(APT::StringView S) const APT_PURE; public: @@ -228,11 +222,7 @@ class pkgCache /*{{{*/ inline void *DataEnd() {return ((unsigned char *)Map.Data()) + Map.Size();} // String hashing function (512 range) -#ifdef APT_PKG_EXPOSE_STRING_VIEW - APT_HIDDEN inline map_id_t Hash(APT::StringView S) const {return sHash(S);} -#endif - inline map_id_t Hash(const std::string &S) const {return sHash(S);} - inline map_id_t Hash(const char *S) const {return sHash(S);} + inline map_id_t Hash(APT::StringView S) const {return sHash(S);} APT_HIDDEN uint32_t CacheHash(); @@ -240,25 +230,16 @@ class pkgCache /*{{{*/ static const char *Priority(unsigned char Priority); // Accessors -#ifdef APT_PKG_EXPOSE_STRING_VIEW - APT_HIDDEN GrpIterator FindGrp(APT::StringView Name); - APT_HIDDEN PkgIterator FindPkg(APT::StringView Name); - APT_HIDDEN PkgIterator FindPkg(APT::StringView Name, APT::StringView Arch); -#endif + GrpIterator FindGrp(APT::StringView Name); + PkgIterator FindPkg(APT::StringView Name); + PkgIterator FindPkg(APT::StringView Name, APT::StringView Arch); -#ifdef APT_PKG_EXPOSE_STRING_VIEW APT::StringView 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); } -#endif - - - GrpIterator FindGrp(const std::string &Name); - PkgIterator FindPkg(const std::string &Name); - PkgIterator FindPkg(const std::string &Name, const std::string &Arch); Header &Head() {return *HeaderP;} inline GrpIterator GrpBegin(); |