diff options
Diffstat (limited to 'apt-pkg')
| -rw-r--r-- | apt-pkg/contrib/hashes.cc | 12 | ||||
| -rw-r--r-- | apt-pkg/contrib/hashes.h | 13 |
2 files changed, 16 insertions, 9 deletions
diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc index 0ad51fff0..06bfd003e 100644 --- a/apt-pkg/contrib/hashes.cc +++ b/apt-pkg/contrib/hashes.cc @@ -3,10 +3,10 @@ /* ###################################################################### Hashes - Simple wrapper around the hash functions - + This is just used to make building the methods simpler, this is the only interface required.. - + ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ @@ -66,7 +66,11 @@ HashString::HashString(std::string Type, std::string Hash) : Type(Type), Hash(Ha { } -HashString::HashString(std::string StringedHash) /*{{{*/ +#if APT_PKG_ABI > 600 +HashString::HashString(std::string_view StringedHash) /*{{{*/ +#else +HashString::HashString(std::string StringedHash) /*{{{*/ +#endif { if (StringedHash.find(":") == std::string::npos) { @@ -80,7 +84,7 @@ HashString::HashString(std::string StringedHash) /*{{{*/ std::clog << "HashString(string): invalid StringedHash " << StringedHash << std::endl; return; } - std::string::size_type pos = StringedHash.find(":"); + auto pos = StringedHash.find(":"); Type = StringedHash.substr(0,pos); Hash = StringedHash.substr(pos+1, StringedHash.size() - pos); diff --git a/apt-pkg/contrib/hashes.h b/apt-pkg/contrib/hashes.h index e259b4e28..69b742f10 100644 --- a/apt-pkg/contrib/hashes.h +++ b/apt-pkg/contrib/hashes.h @@ -3,10 +3,10 @@ /* ###################################################################### Hashes - Simple wrapper around the hash functions - + This is just used to make building the methods simpler, this is the only interface required.. - + ##################################################################### */ /*}}}*/ #ifndef APTPKG_HASHES_H @@ -15,7 +15,6 @@ #include <apt-pkg/macros.h> #ifdef APT_COMPILING_APT -#include <apt-pkg/string_view.h> #include <apt-pkg/tagfile-keys.h> #endif @@ -41,7 +40,11 @@ class APT_PUBLIC HashString public: HashString(std::string Type, std::string Hash); +#if APT_PKG_ABI > 600 + explicit HashString(std::string_view StringedHashString); // init from str as "type:hash" +#else explicit HashString(std::string StringedHashString); // init from str as "type:hash" +#endif HashString(); // get hash type used @@ -66,9 +69,9 @@ class APT_PUBLIC HashString static APT_PURE const char** SupportedHashes(); #ifdef APT_COMPILING_APT struct APT_HIDDEN HashSupportInfo { - APT::StringView name; + std::string_view name; pkgTagSection::Key namekey; - APT::StringView chksumsname; + std::string_view chksumsname; pkgTagSection::Key chksumskey; }; APT_HIDDEN static std::vector<HashSupportInfo> SupportedHashesInfo(); |
