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/contrib/strutl.cc | 6 +++--- apt-pkg/contrib/strutl.h | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'apt-pkg/contrib') diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index 69a67188e..5d91e5f11 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -104,7 +104,7 @@ std::string Join(std::vector list, const std::string &sep) } // Returns string display length honoring multi-byte characters -size_t DisplayLength(StringView str) +size_t DisplayLength(string_view str) { size_t len = 0; @@ -930,7 +930,7 @@ string TimeRFC1123(time_t Date, bool const NumericTimezone) auto const posix = std::locale::classic(); std::ostringstream datestr; datestr.imbue(posix); - APT::StringView const fmt("%a, %d %b %Y %H:%M:%S"); + std::string_view const fmt("%a, %d %b %Y %H:%M:%S"); std::use_facet>(posix).put( std::ostreambuf_iterator(datestr), datestr, ' ', &Conv, fmt.data(), fmt.data() + fmt.size()); @@ -1307,7 +1307,7 @@ static int HexDigit(int c) // Hex2Num - Convert a long hex number into a buffer /*{{{*/ // --------------------------------------------------------------------- /* The length of the buffer must be exactly 1/2 the length of the string. */ -bool Hex2Num(const APT::StringView Str,unsigned char *Num,unsigned int Length) +bool Hex2Num(const std::string_view Str,unsigned char *Num,unsigned int Length) { if (Str.length() != Length*2) return false; diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h index fdaa23766..9db908c7f 100644 --- a/apt-pkg/contrib/strutl.h +++ b/apt-pkg/contrib/strutl.h @@ -19,7 +19,6 @@ #ifndef STRUTL_H #define STRUTL_H -#include #include #include #include @@ -48,7 +47,7 @@ namespace APT { APT_PUBLIC bool Startswith(const std::string &s, const std::string &starting); APT_PUBLIC std::string Join(std::vector list, const std::string &sep); // Returns string display length honoring multi-byte characters - APT_PUBLIC size_t DisplayLength(StringView str); + APT_PUBLIC size_t DisplayLength(std::string_view str); } } @@ -106,7 +105,7 @@ APT_PUBLIC bool StrToNum(const char *Str,unsigned long &Res,unsigned Len,unsigne APT_PUBLIC bool StrToNum(const char *Str,unsigned long long &Res,unsigned Len,unsigned Base = 0); APT_PUBLIC bool Base256ToNum(const char *Str,unsigned long &Res,unsigned int Len); APT_PUBLIC bool Base256ToNum(const char *Str,unsigned long long &Res,unsigned int Len); -APT_PUBLIC bool Hex2Num(const APT::StringView Str,unsigned char *Num,unsigned int Length); +APT_PUBLIC bool Hex2Num(const std::string_view Str,unsigned char *Num,unsigned int Length); // input changing string split APT_PUBLIC bool TokSplitString(char Tok,char *Input,char **List, unsigned long ListMax); -- cgit v1.2.3-70-g09d2