summaryrefslogtreecommitdiff
path: root/apt-pkg/tagfile.h
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-09-27 17:32:24 +0200
committerJulian Andres Klode <jak@debian.org>2016-11-22 22:57:46 +0100
commitabfd07702c1bbc3ed489d015b43db58ab677af0c (patch)
treef0a17b59197362b909f2b70ddbc6f3fed5049778 /apt-pkg/tagfile.h
parente07f3d5a9ed2870a0e2909cc1e5e55e826086c53 (diff)
TagSection: Introduce functions for looking up by key ids
Introduce a new enum class and add functions that can do a lookup with that enum class. This uses triehash.
Diffstat (limited to 'apt-pkg/tagfile.h')
-rw-r--r--apt-pkg/tagfile.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h
index cdca54756..3b89d0e45 100644
--- a/apt-pkg/tagfile.h
+++ b/apt-pkg/tagfile.h
@@ -89,7 +89,19 @@ class pkgTagSection
std::string FindS(const char *Tag) const;
std::string FindRawS(const char *Tag) const;
+ // Functions for lookup with a perfect hash function
+ enum class Key;
+ APT_HIDDEN bool Find(Key key,const char *&Start, const char *&End) const;
+ APT_HIDDEN bool Find(Key key,unsigned int &Pos) const;
+ APT_HIDDEN signed int FindI(Key key,signed long Default = 0) const;
+ APT_HIDDEN bool FindB(Key key, bool Default = false) const;
+ APT_HIDDEN unsigned long long FindULL(Key key, unsigned long long const &Default = 0) const;
+ APT_HIDDEN bool FindFlag(Key key,uint8_t &Flags, uint8_t const Flag) const;
+ APT_HIDDEN bool FindFlag(Key key,unsigned long &Flags, unsigned long Flag) const;
+ APT_HIDDEN bool Exists(Key key) const;
#ifdef APT_PKG_EXPOSE_STRING_VIEW
+ APT_HIDDEN APT::StringView Find(Key key) const;
+ APT_HIDDEN APT::StringView FindRaw(Key key) const;
APT_HIDDEN bool Find(APT::StringView Tag,const char *&Start, const char *&End) const;
APT_HIDDEN bool Find(APT::StringView Tag,unsigned int &Pos) const;
APT_HIDDEN APT::StringView Find(APT::StringView Tag) const;