From e0c969324c4c1196b5ec31f925c602ffcbe5080c Mon Sep 17 00:00:00 2001 From: наб Date: Tue, 12 Nov 2024 17:59:21 +0100 Subject: apt-pkg/edsp.cc: APT::StringView -> std::string_view --- apt-pkg/edsp.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 0ffde46c0..d3ce830ea 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -55,7 +54,7 @@ constexpr char const * const DepMap[] = { // WriteOkay - varaidic helper to easily Write to a FileFd /*{{{*/ static bool WriteOkay_fn(FileFd &) { return true; } -template static bool WriteOkay_fn(FileFd &output, APT::StringView data, Tail... more_data) +template static bool WriteOkay_fn(FileFd &output, std::string_view data, Tail... more_data) { return likely(output.Write(data.data(), data.length()) && WriteOkay_fn(output, more_data...)); } @@ -217,7 +216,7 @@ static bool checkKnownArchitecture(std::string const &arch) /*{{{*/ return std::find(veryforeign.begin(), veryforeign.end(), arch) != veryforeign.end(); } /*}}}*/ -static bool WriteGenericRequestHeaders(FileFd &output, APT::StringView const head)/*{{{*/ +static bool WriteGenericRequestHeaders(FileFd &output, std::string_view const head)/*{{{*/ { bool Okay = WriteOkay(output, head, "Architecture: ", _config->Find("APT::Architecture"), "\n", "Architectures:"); @@ -537,7 +536,7 @@ static bool localStringToBool(std::string answer, bool const defValue) { return defValue; } /*}}}*/ -static bool LineStartsWithAndStrip(std::string &line, APT::StringView const with)/*{{{*/ +static bool LineStartsWithAndStrip(std::string &line, std::string_view const with)/*{{{*/ { if (line.compare(0, with.size(), with.data()) != 0) return false; @@ -545,7 +544,7 @@ static bool LineStartsWithAndStrip(std::string &line, APT::StringView const with return true; } /*}}}*/ -static bool ReadFlag(unsigned int &flags, std::string &line, APT::StringView const name, unsigned int const setflag)/*{{{*/ +static bool ReadFlag(unsigned int &flags, std::string &line, std::string_view const name, unsigned int const setflag)/*{{{*/ { if (LineStartsWithAndStrip(line, name) == false) return false; @@ -985,14 +984,14 @@ bool EIPP::WriteScenario(pkgDepCache &Cache, FileFd &output, OpProgress * const pkgset[P->ID] = true; if (strcmp(P.Arch(), "any") == 0) { - APT::StringView const pkgname(P.Name()); + std::string_view const pkgname(P.Name()); auto const idxColon = pkgname.find(':'); - if (idxColon != APT::StringView::npos) + if (idxColon != std::string_view::npos) { pkgCache::PkgIterator PA; if (pkgname.substr(idxColon + 1) == "any") { - auto const GA = Cache.FindGrp(pkgname.substr(0, idxColon).to_string()); + auto const GA = Cache.FindGrp(pkgname.substr(0, idxColon)); for (auto PA = GA.PackageList(); PA.end() == false; PA = GA.NextPkg(PA)) { pkgset[PA->ID] = true; @@ -1000,7 +999,7 @@ bool EIPP::WriteScenario(pkgDepCache &Cache, FileFd &output, OpProgress * const } else { - auto const PA = Cache.FindPkg(pkgname.to_string()); + auto const PA = Cache.FindPkg(pkgname); if (PA.end() == false) pkgset[PA->ID] = true; } -- cgit v1.2.3-70-g09d2