apt 2.9.14 commandline package manager

debsrcrecords.h
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
3/* ######################################################################
4
5 Debian Source Package Records - Parser implementation for Debian style
6 source indexes
7
8 ##################################################################### */
9 /*}}}*/
10#ifndef PKGLIB_DEBSRCRECORDS_H
11#define PKGLIB_DEBSRCRECORDS_H
12
13#include <apt-pkg/fileutl.h>
14#include <apt-pkg/srcrecords.h>
15#include <apt-pkg/tagfile-keys.h>
16#include <apt-pkg/tagfile.h>
17
18#include <cstddef>
19#include <string>
20#include <vector>
21
22 class pkgIndexFile;
23
24 class APT_HIDDEN debSrcRecordParser : public pkgSrcRecords::Parser
25{
27 void * const d;
28
29 protected:
30 FileFd Fd;
31 pkgTagFile Tags;
32 pkgTagSection Sect;
33 std::vector<const char*> StaticBinList;
34 unsigned long iOffset;
35 char *Buffer;
36
37 public:
38
39 virtual bool Restart() APT_OVERRIDE {return Jump(0);};
40 virtual bool Step() APT_OVERRIDE {iOffset = Tags.Offset(); return Tags.Step(Sect);};
41 virtual bool Jump(unsigned long const &Off) APT_OVERRIDE {iOffset = Off; return Tags.Jump(Sect,Off);};
42
43 virtual std::string Package() const APT_OVERRIDE;
44 virtual std::string Version() const APT_OVERRIDE {return std::string{Sect.Find(pkgTagSection::Key::Version)};};
45 virtual std::string Maintainer() const APT_OVERRIDE {return std::string{Sect.Find(pkgTagSection::Key::Maintainer)};};
46 virtual std::string Section() const APT_OVERRIDE {return std::string{Sect.Find(pkgTagSection::Key::Section)};};
47 virtual const char **Binaries() APT_OVERRIDE;
48 virtual bool BuildDepends(std::vector<BuildDepRec> &BuildDeps, bool const &ArchOnly, bool const &StripMultiArch = true) APT_OVERRIDE;
49 virtual unsigned long Offset() APT_OVERRIDE {return iOffset;};
50 virtual std::string AsStr() APT_OVERRIDE
51 {
52 const char *Start=0,*Stop=0;
53 Sect.GetSection(Start,Stop);
54 return std::string(Start,Stop);
55 };
56 virtual bool Files(std::vector<pkgSrcRecords::File> &F) APT_OVERRIDE;
57
58 debSrcRecordParser(std::string const &File,pkgIndexFile const *Index);
59 virtual ~debSrcRecordParser();
60};
61
62 class APT_HIDDEN debDscRecordParser : public debSrcRecordParser
63{
64 public:
65 debDscRecordParser(std::string const &DscFile, pkgIndexFile const *Index);
66};
67
68#endif
FileFd
Definition fileutl.h:42
debDscRecordParser
Definition debsrcrecords.h:63
debSrcRecordParser
Definition debsrcrecords.h:25
pkgIndexFile
Definition indexfile.h:103
pkgSrcRecords::Parser
Definition srcrecords.h:39
pkgSrcRecords::Parser::BuildDepends
virtual bool BuildDepends(std::vector< BuildDepRec > &BuildDeps, bool const &ArchOnly, bool const &StripMultiArch=true)=0
pkgTagFile
Definition tagfile.h:191
pkgTagSection
Definition tagfile.h:45