From 45ecab4458c4015b7635042064165c229e099c28 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 27 Sep 2016 16:49:25 +0200 Subject: TagSection: Extract Find() methods taking Pos instead of Key This allows us to add a perfect hash function to the tag file without having to reimplement the methods a second time. --- apt-pkg/tagfile.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'apt-pkg/tagfile.h') diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index f0f2f48c6..cdca54756 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -54,6 +54,17 @@ class pkgTagSection pkgTagSectionPrivate * const d; + APT_HIDDEN bool FindInternal(unsigned int Pos,const char *&Start, const char *&End) const; +#if defined(APT_PKG_EXPOSE_STRING_VIEW) + APT_HIDDEN APT::StringView FindInternal(unsigned int Pos) const; + APT_HIDDEN APT::StringView FindRawInternal(unsigned int Pos) const; +#endif + APT_HIDDEN signed int FindIInternal(unsigned int Pos,signed long Default = 0) const; + APT_HIDDEN bool FindBInternal(unsigned int Pos, bool Default = false) const; + APT_HIDDEN unsigned long long FindULLInternal(unsigned int Pos, unsigned long long const &Default = 0) const; + APT_HIDDEN bool FindFlagInternal(unsigned int Pos,uint8_t &Flags, uint8_t const Flag) const; + APT_HIDDEN bool FindFlagInternal(unsigned int Pos,unsigned long &Flags, unsigned long Flag) const; + protected: const char *Stop; -- cgit v1.2.3