apt: apt-pkg/deb/debsrcrecords.h Source File

apt 2.3.15 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.h>
16
17#include <string>
18#include <vector>
19#include <stddef.h>
20
21class pkgIndexFile;
22
23 class APT_HIDDEN debSrcRecordParser : public pkgSrcRecords::Parser
24{
26 void * const d;
27
28 protected:
29 FileFd Fd;
30 pkgTagFile Tags;
31 pkgTagSection Sect;
32 std::vector<const char*> StaticBinList;
33 unsigned long iOffset;
34 char *Buffer;
35
36 public:
37
38 virtual bool Restart() APT_OVERRIDE {return Jump(0);};
39 virtual bool Step() APT_OVERRIDE {iOffset = Tags.Offset(); return Tags.Step(Sect);};
40 virtual bool Jump(unsigned long const &Off) APT_OVERRIDE {iOffset = Off; return Tags.Jump(Sect,Off);};
41
42 virtual std::string Package() const APT_OVERRIDE;
43 virtual std::string Version() const APT_OVERRIDE {return Sect.FindS("Version");};
44 virtual std::string Maintainer() const APT_OVERRIDE {return Sect.FindS("Maintainer");};
45 virtual std::string Section() const APT_OVERRIDE {return Sect.FindS("Section");};
46 virtual const char **Binaries() APT_OVERRIDE;
47 virtual bool BuildDepends(std::vector<BuildDepRec> &BuildDeps, bool const &ArchOnly, bool const &StripMultiArch = true) APT_OVERRIDE;
48 virtual unsigned long Offset() APT_OVERRIDE {return iOffset;};
49 virtual std::string AsStr() APT_OVERRIDE
50 {
51 const char *Start=0,*Stop=0;
52 Sect.GetSection(Start,Stop);
53 return std::string(Start,Stop);
54 };
55 virtual bool Files(std::vector<pkgSrcRecords::File> &F) APT_OVERRIDE;
56
57 debSrcRecordParser(std::string const &File,pkgIndexFile const *Index);
58 virtual ~debSrcRecordParser();
59};
60
61 class APT_HIDDEN debDscRecordParser : public debSrcRecordParser
62{
63 public:
64 debDscRecordParser(std::string const &DscFile, pkgIndexFile const *Index);
65};
66
67#endif
FileFd
Definition: fileutl.h:39
debDscRecordParser
Definition: debsrcrecords.h:62
debSrcRecordParser
Definition: debsrcrecords.h:24
pkgIndexFile
Definition: indexfile.h:102
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:174
pkgTagSection
Definition: tagfile.h:45