summaryrefslogtreecommitdiffstats
path: root/apt-pkg/deb/debsrcrecords.h
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/deb/debsrcrecords.h
parentInitial commit. (diff)
downloadapt-a2079028732f30f4b85b1e599887c566466d695d.tar.xz
apt-a2079028732f30f4b85b1e599887c566466d695d.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/deb/debsrcrecords.h')
-rw-r--r--apt-pkg/deb/debsrcrecords.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/apt-pkg/deb/debsrcrecords.h b/apt-pkg/deb/debsrcrecords.h
new file mode 100644
index 0000000..45617f6
--- /dev/null
+++ b/apt-pkg/deb/debsrcrecords.h
@@ -0,0 +1,68 @@
+// -*- mode: cpp; mode: fold -*-
+// Description /*{{{*/
+/* ######################################################################
+
+ Debian Source Package Records - Parser implementation for Debian style
+ source indexes
+
+ ##################################################################### */
+ /*}}}*/
+#ifndef PKGLIB_DEBSRCRECORDS_H
+#define PKGLIB_DEBSRCRECORDS_H
+
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/srcrecords.h>
+#include <apt-pkg/tagfile.h>
+
+#include <string>
+#include <vector>
+#include <stddef.h>
+
+class pkgIndexFile;
+
+class APT_HIDDEN debSrcRecordParser : public pkgSrcRecords::Parser
+{
+ /** \brief dpointer placeholder (for later in case we need it) */
+ void * const d;
+
+ protected:
+ FileFd Fd;
+ pkgTagFile Tags;
+ pkgTagSection Sect;
+ std::vector<const char*> StaticBinList;
+ unsigned long iOffset;
+ char *Buffer;
+
+ public:
+
+ virtual bool Restart() APT_OVERRIDE {return Jump(0);};
+ virtual bool Step() APT_OVERRIDE {iOffset = Tags.Offset(); return Tags.Step(Sect);};
+ virtual bool Jump(unsigned long const &Off) APT_OVERRIDE {iOffset = Off; return Tags.Jump(Sect,Off);};
+
+ virtual std::string Package() const APT_OVERRIDE;
+ virtual std::string Version() const APT_OVERRIDE {return Sect.FindS("Version");};
+ virtual std::string Maintainer() const APT_OVERRIDE {return Sect.FindS("Maintainer");};
+ virtual std::string Section() const APT_OVERRIDE {return Sect.FindS("Section");};
+ virtual const char **Binaries() APT_OVERRIDE;
+ virtual bool BuildDepends(std::vector<BuildDepRec> &BuildDeps, bool const &ArchOnly, bool const &StripMultiArch = true) APT_OVERRIDE;
+ virtual unsigned long Offset() APT_OVERRIDE {return iOffset;};
+ virtual std::string AsStr() APT_OVERRIDE
+ {
+ const char *Start=0,*Stop=0;
+ Sect.GetSection(Start,Stop);
+ return std::string(Start,Stop);
+ };
+ virtual bool Files(std::vector<pkgSrcRecords::File> &F) APT_OVERRIDE;
+ bool Files2(std::vector<pkgSrcRecords::File2> &F);
+
+ debSrcRecordParser(std::string const &File,pkgIndexFile const *Index);
+ virtual ~debSrcRecordParser();
+};
+
+class APT_HIDDEN debDscRecordParser : public debSrcRecordParser
+{
+ public:
+ debDscRecordParser(std::string const &DscFile, pkgIndexFile const *Index);
+};
+
+#endif