]>
git.saurik.com Git - apt.git/blob - apt-pkg/deb/debsrcrecords.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: debsrcrecords.h,v 1.4 1999/10/18 03:44:39 jgg 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>
21 class debSrcRecordParser
: public pkgSrcRecords::Parser
26 const char *StaticBinList
[400];
27 unsigned long iOffset
;
31 virtual bool Restart() {return Tags
.Jump(Sect
,0);};
32 virtual bool Step() {iOffset
= Tags
.Offset(); return Tags
.Step(Sect
);};
33 virtual bool Jump(unsigned long Off
) {iOffset
= Off
; return Tags
.Jump(Sect
,Off
);};
35 virtual string
Package() {return Sect
.FindS("Package");};
36 virtual string
Version() {return Sect
.FindS("Version");};
37 virtual string
Maintainer() {return Sect
.FindS("Maintainer");};
38 virtual string
Section() {return Sect
.FindS("Section");};
39 virtual const char **Binaries();
40 virtual unsigned long Offset() {return iOffset
;};
41 virtual unsigned long Length() {return Sec
.size();};
42 virtual string
AsStr()
44 const char *Start
,Stop
;
45 Sect
.GetSection(Start
,Stop
);
46 return string(Start
,Stop
);
48 virtual bool Files(vector
<pkgSrcRecords::File
> &F
);
50 debSrcRecordParser(FileFd
*File
,pkgSourceList::const_iterator SrcItem
) :
52 Tags(*File
,sizeof(Buffer
)) {};