X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/eff0c22e59e65b6b63e854ff41eb091278e05714..90f2a7a0f66cfc259883490a5fcf40f7d0696cfe:/apt-pkg/deb/deblistparser.h diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h index ad134f8e6..a78312f9d 100644 --- a/apt-pkg/deb/deblistparser.h +++ b/apt-pkg/deb/deblistparser.h @@ -33,12 +33,14 @@ class APT_HIDDEN debListParser : public pkgCacheListParser { public: +#ifdef APT_PKG_EXPOSE_STRING_VIEW // Parser Helper struct WordList { - const char *Str; + APT::StringView Str; unsigned char Val; }; +#endif private: /** \brief dpointer placeholder (for later in case we need it) */ @@ -50,8 +52,10 @@ class APT_HIDDEN debListParser : public pkgCacheListParser map_filesize_t iOffset; virtual bool ParseStatus(pkgCache::PkgIterator &Pkg,pkgCache::VerIterator &Ver); - bool ParseDepends(pkgCache::VerIterator &Ver,const char *Tag, +#ifdef APT_PKG_EXPOSE_STRING_VIEW + bool ParseDepends(pkgCache::VerIterator &Ver, APT::StringView Tag, unsigned int Type); +#endif bool ParseProvides(pkgCache::VerIterator &Ver); #ifdef APT_PKG_EXPOSE_STRING_VIEW @@ -65,14 +69,12 @@ class APT_HIDDEN debListParser : public pkgCacheListParser // These all operate against the current section virtual std::string Package() APT_OVERRIDE; - virtual std::string Architecture() APT_OVERRIDE; virtual bool ArchitectureAll() APT_OVERRIDE; - virtual std::string Version() APT_OVERRIDE; - virtual bool NewVersion(pkgCache::VerIterator &Ver) APT_OVERRIDE; - virtual std::string Description(std::string const &lang) APT_OVERRIDE; #ifdef APT_PKG_EXPOSE_STRING_VIEW - APT::StringView Description(APT::StringView lang); + virtual APT::StringView Architecture() APT_OVERRIDE; + virtual APT::StringView Version() APT_OVERRIDE; #endif + virtual bool NewVersion(pkgCache::VerIterator &Ver) APT_OVERRIDE; virtual std::vector AvailableDescriptionLanguages() APT_OVERRIDE; virtual MD5SumValue Description_md5() APT_OVERRIDE; virtual unsigned short VersionHash() APT_OVERRIDE; @@ -128,9 +130,11 @@ class APT_HIDDEN debDebFileParser : public debListParser class APT_HIDDEN debTranslationsParser : public debListParser { public: +#ifdef APT_PKG_EXPOSE_STRING_VIEW // a translation can never be a real package - virtual std::string Architecture() APT_OVERRIDE { return ""; } - virtual std::string Version() APT_OVERRIDE { return ""; } + virtual APT::StringView Architecture() APT_OVERRIDE { return ""; } + virtual APT::StringView Version() APT_OVERRIDE { return ""; } +#endif debTranslationsParser(FileFd *File) : debListParser(File) {};