summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
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/contrib
parent6de55404ca8ce296ccf14880c6115b6d8eb4e0b9 (diff)
APT::StringView -> std::string_view [textonly]
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/strutl.cc6
-rw-r--r--apt-pkg/contrib/strutl.h5
2 files changed, 5 insertions, 6 deletions
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<std::string> 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<std::time_put<char>>(posix).put(
std::ostreambuf_iterator<char>(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 <apt-pkg/string_view.h>
#include <cstddef>
#include <cstring>
#include <ctime>
@@ -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<std::string> 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);