1 // -*- mode: cpp; mode: fold -*-
3 // $Id: debsrcrecords.h,v 1.8 2004/03/17 05:58:54 mdz Exp $
4 /* ######################################################################
6 Debian Source Package Records - Parser implementation for Debian style
9 ##################################################################### */
11 #ifndef PKGLIB_DEBSRCRECORDS_H
12 #define PKGLIB_DEBSRCRECORDS_H
14 #include <apt-pkg/srcrecords.h>
15 #include <apt-pkg/tagfile.h>
16 #include <apt-pkg/fileutl.h>
24 class APT_HIDDEN debSrcRecordParser
: public pkgSrcRecords::Parser
26 /** \brief dpointer placeholder (for later in case we need it) */
33 std::vector
<const char*> StaticBinList
;
34 unsigned long iOffset
;
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
);};
43 virtual std::string
Package() const APT_OVERRIDE
{return Sect
.FindS("Package");};
44 virtual std::string
Version() const APT_OVERRIDE
{return Sect
.FindS("Version");};
45 virtual std::string
Maintainer() const APT_OVERRIDE
{return Sect
.FindS("Maintainer");};
46 virtual std::string
Section() const APT_OVERRIDE
{return Sect
.FindS("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
52 const char *Start
=0,*Stop
=0;
53 Sect
.GetSection(Start
,Stop
);
54 return std::string(Start
,Stop
);
56 virtual bool Files(std::vector
<pkgSrcRecords::File
> &F
) APT_OVERRIDE
;
57 bool Files2(std::vector
<pkgSrcRecords::File2
> &F
);
59 debSrcRecordParser(std::string
const &File
,pkgIndexFile
const *Index
);
60 virtual ~debSrcRecordParser();
63 class APT_HIDDEN debDscRecordParser
: public debSrcRecordParser
66 debDscRecordParser(std::string
const &DscFile
, pkgIndexFile
const *Index
);