summaryrefslogtreecommitdiffstats
path: root/apt-pkg/tagfile-compat.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 18:07:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 18:07:13 +0000
commit636c7dc17286d93d788c741d15fd756aeda066d5 (patch)
treee7ae158cc54f591041a061b9865bcae51854f15c /apt-pkg/tagfile-compat.cc
parentInitial commit. (diff)
downloadapt-upstream/1.8.2.3.tar.xz
apt-upstream/1.8.2.3.zip
Adding upstream version 1.8.2.3.upstream/1.8.2.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'apt-pkg/tagfile-compat.cc')
-rw-r--r--apt-pkg/tagfile-compat.cc75
1 files changed, 75 insertions, 0 deletions
diff --git a/apt-pkg/tagfile-compat.cc b/apt-pkg/tagfile-compat.cc
new file mode 100644
index 0000000..1e1d23e
--- /dev/null
+++ b/apt-pkg/tagfile-compat.cc
@@ -0,0 +1,75 @@
+// -*- mode: cpp; mode: fold -*-
+// Description /*{{{*/
+/* ######################################################################
+
+ Fast scanner for RFC-822 type header information
+
+ This uses a rotating buffer to load the package information into.
+ The scanner runs over it and isolates and indexes a single section.
+
+ This defines compat functions for the external code.
+
+ ##################################################################### */
+ /*}}}*/
+
+#include <config.h>
+#define APT_COMPILING_TAGFILE_COMPAT_CC
+#include <apt-pkg/tagfile.h>
+
+using std::string;
+using APT::StringView;
+
+
+bool pkgTagSection::Exists(const char* const Tag) const
+{
+ return Exists(StringView(Tag));
+}
+
+bool pkgTagSection::Find(const char *Tag,unsigned int &Pos) const
+{
+ return Find(StringView(Tag), Pos);
+}
+
+bool pkgTagSection::Find(const char *Tag,const char *&Start,
+ const char *&End) const
+{
+ return Find(StringView(Tag), Start, End);
+}
+
+string pkgTagSection::FindS(const char *Tag) const
+{
+ return Find(StringView(Tag)).to_string();
+}
+
+string pkgTagSection::FindRawS(const char *Tag) const
+{
+ return FindRaw(StringView(Tag)).to_string();
+}
+
+signed int pkgTagSection::FindI(const char *Tag,signed long Default) const
+{
+ return FindI(StringView(Tag), Default);
+}
+
+unsigned long long pkgTagSection::FindULL(const char *Tag, unsigned long long const &Default) const
+{
+ return FindULL(StringView(Tag), Default);
+}
+ /*}}}*/
+
+bool pkgTagSection::FindB(const char *Tag, bool const &Default) const
+{
+ return FindB(StringView(Tag), Default);
+}
+
+bool pkgTagSection::FindFlag(const char * const Tag, uint8_t &Flags,
+ uint8_t const Flag) const
+{
+ return FindFlag(StringView(Tag), Flags, Flag);
+}
+
+bool pkgTagSection::FindFlag(const char *Tag,unsigned long &Flags,
+ unsigned long Flag) const
+{
+ return FindFlag(StringView(Tag), Flags, Flag);
+}