]>
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 #pragma interface "apt-pkg/debsrcrecords.h"
18 #include <apt-pkg/srcrecords.h>
19 #include <apt-pkg/tagfile.h>
20 #include <apt-pkg/fileutl.h>
22 class debSrcRecordParser
: public pkgSrcRecords::Parser
27 char *StaticBinList
[400];
28 unsigned long iOffset
;
30 unsigned long BufSize
;
34 virtual bool Restart() {return Tags
.Jump(Sect
,0);};
35 virtual bool Step() {iOffset
= Tags
.Offset(); return Tags
.Step(Sect
);};
36 virtual bool Jump(unsigned long Off
) {iOffset
= Off
; return Tags
.Jump(Sect
,Off
);};
38 virtual string
Package() const {return Sect
.FindS("Package");};
39 virtual string
Version() const {return Sect
.FindS("Version");};
40 virtual string
Maintainer() const {return Sect
.FindS("Maintainer");};
41 virtual string
Section() const {return Sect
.FindS("Section");};
42 virtual const char **Binaries();
43 virtual bool BuildDepends(vector
<BuildDepRec
> &BuildDeps
, bool ArchOnly
);
44 virtual unsigned long Offset() {return iOffset
;};
45 virtual string
AsStr()
47 const char *Start
=0,*Stop
=0;
48 Sect
.GetSection(Start
,Stop
);
49 return string(Start
,Stop
);
51 virtual bool Files(vector
<pkgSrcRecords::File
> &F
);
53 debSrcRecordParser(string File
,pkgIndexFile
const *Index
)
54 : Parser(Index
), Fd(File
,FileFd::ReadOnly
), Tags(&Fd
,102400),
55 Buffer(0), BufSize(0) {}