]>
git.saurik.com Git - apt.git/blob - apt-pkg/deb/debsrcrecords.h
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
15 #include <apt-pkg/srcrecords.h>
16 #include <apt-pkg/tagfile.h>
17 #include <apt-pkg/fileutl.h>
19 class debSrcRecordParser
: public pkgSrcRecords::Parser
21 /** \brief dpointer placeholder (for later in case we need it) */
27 std::vector
<const char*> StaticBinList
;
28 unsigned long iOffset
;
33 virtual bool Restart() {return Tags
.Jump(Sect
,0);};
34 virtual bool Step() {iOffset
= Tags
.Offset(); return Tags
.Step(Sect
);};
35 virtual bool Jump(unsigned long const &Off
) {iOffset
= Off
; return Tags
.Jump(Sect
,Off
);};
37 virtual std::string
Package() const {return Sect
.FindS("Package");};
38 virtual std::string
Version() const {return Sect
.FindS("Version");};
39 virtual std::string
Maintainer() const {return Sect
.FindS("Maintainer");};
40 virtual std::string
Section() const {return Sect
.FindS("Section");};
41 virtual const char **Binaries();
42 virtual bool BuildDepends(std::vector
<BuildDepRec
> &BuildDeps
, bool const &ArchOnly
, bool const &StripMultiArch
= true);
43 virtual unsigned long Offset() {return iOffset
;};
44 virtual std::string
AsStr()
46 const char *Start
=0,*Stop
=0;
47 Sect
.GetSection(Start
,Stop
);
48 return std::string(Start
,Stop
);
50 virtual bool Files(std::vector
<pkgSrcRecords::File
> &F
);
52 debSrcRecordParser(std::string
const &File
,pkgIndexFile
const *Index
)
53 : Parser(Index
), Fd(File
,FileFd::ReadOnly
, FileFd::Extension
), Tags(&Fd
,102400),
55 virtual ~debSrcRecordParser();