From 982998a061461a503352d85b1d0a76a99c8480cd Mon Sep 17 00:00:00 2001 From: наб Date: Tue, 12 Nov 2024 17:59:21 +0100 Subject: apt-pkg/edsp/edsplistparser.cc: APT::StringView -> std::string_view --- apt-pkg/deb/deblistparser.cc | 2 +- apt-pkg/deb/deblistparser.h | 2 +- apt-pkg/edsp/edsplistparser.cc | 7 +++---- apt-pkg/edsp/edsplistparser.h | 5 +---- apt-pkg/pkgcachegen.cc | 4 ++-- apt-pkg/pkgcachegen.h | 2 +- 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 13e8fd06d..f9835f797 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -280,7 +280,7 @@ std::vector debListParser::AvailableDescriptionLanguages() description. If no Description-md5 is found in the section it will be calculated. */ -APT::StringView debListParser::Description_md5() +std::string_view debListParser::Description_md5() { return Section.Find(pkgTagSection::Key::Description_md5); } diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h index e6767d7d5..1070e806d 100644 --- a/apt-pkg/deb/deblistparser.h +++ b/apt-pkg/deb/deblistparser.h @@ -66,7 +66,7 @@ class APT_HIDDEN debListParser : public pkgCacheListParser virtual APT::StringView Version() APT_OVERRIDE; virtual bool NewVersion(pkgCache::VerIterator &Ver) APT_OVERRIDE; virtual std::vector AvailableDescriptionLanguages() APT_OVERRIDE; - virtual APT::StringView Description_md5() APT_OVERRIDE; + virtual std::string_view Description_md5() APT_OVERRIDE; virtual uint32_t VersionHash() APT_OVERRIDE; virtual bool SameVersion(uint32_t Hash, pkgCache::VerIterator const &Ver) APT_OVERRIDE; virtual bool UsePackage(pkgCache::PkgIterator &Pkg, diff --git a/apt-pkg/edsp/edsplistparser.cc b/apt-pkg/edsp/edsplistparser.cc index 183ace654..d3e761be4 100644 --- a/apt-pkg/edsp/edsplistparser.cc +++ b/apt-pkg/edsp/edsplistparser.cc @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -48,7 +47,7 @@ bool edspLikeListParser::NewVersion(pkgCache::VerIterator &Ver) return false; // Patch up the source version, it is stored in the Source-Version field in EDSP. - if (APT::StringView version = Section.Find(pkgTagSection::Key::Source_Version); not version.empty()) + if (std::string_view version = Section.Find(pkgTagSection::Key::Source_Version); not version.empty()) { if (version != Ver.VerStr()) { @@ -67,9 +66,9 @@ std::vector edspLikeListParser::AvailableDescriptionLanguages() { return {}; } -APT::StringView edspLikeListParser::Description_md5() +std::string_view edspLikeListParser::Description_md5() { - return APT::StringView(); + return {}; } /*}}}*/ // ListParser::VersionHash - Compute a unique hash for this version /*{{{*/ diff --git a/apt-pkg/edsp/edsplistparser.h b/apt-pkg/edsp/edsplistparser.h index 41bfd1f79..3f0f3e64c 100644 --- a/apt-pkg/edsp/edsplistparser.h +++ b/apt-pkg/edsp/edsplistparser.h @@ -18,15 +18,12 @@ #include -namespace APT { - class StringView; -} class APT_HIDDEN edspLikeListParser : public debListParser { public: virtual bool NewVersion(pkgCache::VerIterator &Ver) APT_OVERRIDE; virtual std::vector AvailableDescriptionLanguages() APT_OVERRIDE; - virtual APT::StringView Description_md5() APT_OVERRIDE; + virtual std::string_view Description_md5() APT_OVERRIDE; virtual uint32_t VersionHash() APT_OVERRIDE; explicit edspLikeListParser(FileFd *File); diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 981d360d2..1b629bd46 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -339,7 +339,7 @@ bool pkgCacheGenerator::MergeListPackage(ListParser &List, pkgCache::PkgIterator Pkg.Name(), "UsePackage", 1); // Find the right version to write the description - StringView CurMd5 = List.Description_md5(); + std::string_view CurMd5 = List.Description_md5(); std::vector availDesc = List.AvailableDescriptionLanguages(); for (Ver = Pkg.VersionList(); Ver.end() == false; ++Ver) { @@ -506,7 +506,7 @@ bool pkgCacheGenerator::MergeListVersion(ListParser &List, pkgCache::PkgIterator } /* Record the Description(s) based on their master md5sum */ - StringView CurMd5 = List.Description_md5(); + std::string_view CurMd5 = List.Description_md5(); /* Before we add a new description we first search in the group for a version with a description of the same MD5 - if so we reuse this diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h index 420642684..5ac235255 100644 --- a/apt-pkg/pkgcachegen.h +++ b/apt-pkg/pkgcachegen.h @@ -209,7 +209,7 @@ class APT_HIDDEN pkgCacheListParser virtual APT::StringView Version() = 0; virtual bool NewVersion(pkgCache::VerIterator &Ver) = 0; virtual std::vector AvailableDescriptionLanguages() = 0; - virtual APT::StringView Description_md5() = 0; + virtual std::string_view Description_md5() = 0; virtual uint32_t VersionHash() = 0; /** compare currently parsed version with given version * -- cgit v1.2.3-70-g09d2