X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/7f8c0eed6983db7b8959f1498fc8bc80c98d719e..ef6cc0e22a2933e0e36bc260179fdf0b86f9ac26:/apt-pkg/deb/deblistparser.h diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h index 747e022d8..4663c0119 100644 --- a/apt-pkg/deb/deblistparser.h +++ b/apt-pkg/deb/deblistparser.h @@ -19,6 +19,9 @@ #include #include +#ifdef APT_PKG_EXPOSE_STRING_VIEW +#include +#endif #ifndef APT_8_CLEANER_HEADERS #include @@ -30,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) */ @@ -47,10 +52,15 @@ 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); - static bool GrabWord(std::string Word,WordList *List,unsigned char &Out); + +#ifdef APT_PKG_EXPOSE_STRING_VIEW + APT_HIDDEN static bool GrabWord(APT::StringView Word,const WordList *List,unsigned char &Out); +#endif APT_HIDDEN unsigned char ParseMultiArch(bool const showErrors); public: @@ -64,6 +74,9 @@ class APT_HIDDEN debListParser : public pkgCacheListParser 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); +#endif virtual std::vector AvailableDescriptionLanguages() APT_OVERRIDE; virtual MD5SumValue Description_md5() APT_OVERRIDE; virtual unsigned short VersionHash() APT_OVERRIDE; @@ -91,6 +104,14 @@ class APT_HIDDEN debListParser : public pkgCacheListParser bool const &ParseArchFlags, bool const &StripMultiArch, bool const &ParseRestrictionsList); +#ifdef APT_PKG_EXPOSE_STRING_VIEW + APT_HIDDEN static const char *ParseDepends(const char *Start,const char *Stop, + APT::StringView &Package, + APT::StringView &Ver,unsigned int &Op, + bool const ParseArchFlags = false, bool StripMultiArch = true, + bool const ParseRestrictionsList = false); +#endif + APT_PUBLIC static const char *ConvertRelation(const char *I,unsigned int &Op); debListParser(FileFd *File); @@ -119,4 +140,11 @@ class APT_HIDDEN debTranslationsParser : public debListParser : debListParser(File) {}; }; +class APT_HIDDEN debStatusListParser : public debListParser +{ + public: + virtual bool ParseStatus(pkgCache::PkgIterator &Pkg,pkgCache::VerIterator &Ver); + debStatusListParser(FileFd *File) + : debListParser(File) {}; +}; #endif