]>
Commit | Line | Data |
---|---|---|
11e7af84 AL |
1 | // -*- mode: cpp; mode: fold -*- |
2 | // Description /*{{{*/ | |
aaee8293 | 3 | // $Id: debsrcrecords.h,v 1.5 1999/10/18 04:15:25 jgg Exp $ |
11e7af84 AL |
4 | /* ###################################################################### |
5 | ||
6 | Debian Source Package Records - Parser implementation for Debian style | |
7 | source indexes | |
8 | ||
9 | ##################################################################### */ | |
10 | /*}}}*/ | |
11 | #ifndef PKGLIB_DEBSRCRECORDS_H | |
12 | #define PKGLIB_DEBSRCRECORDS_H | |
13 | ||
14 | #ifdef __GNUG__ | |
15 | #pragma interface "apt-pkg/debsrcrecords.h" | |
16 | #endif | |
17 | ||
18 | #include <apt-pkg/srcrecords.h> | |
19 | #include <apt-pkg/tagfile.h> | |
20 | ||
21 | class debSrcRecordParser : public pkgSrcRecords::Parser | |
22 | { | |
23 | pkgTagFile Tags; | |
24 | pkgTagSection Sect; | |
25 | char Buffer[10000]; | |
26 | const char *StaticBinList[400]; | |
27 | unsigned long iOffset; | |
28 | ||
29 | public: | |
30 | ||
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);}; | |
34 | ||
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;}; | |
f8f410f5 AL |
41 | virtual string AsStr() |
42 | { | |
aaee8293 | 43 | const char *Start=0,*Stop=0; |
f8f410f5 AL |
44 | Sect.GetSection(Start,Stop); |
45 | return string(Start,Stop); | |
46 | }; | |
36f610f1 | 47 | virtual bool Files(vector<pkgSrcRecords::File> &F); |
11e7af84 | 48 | |
3782b88d AL |
49 | debSrcRecordParser(FileFd *File,pkgSourceList::const_iterator SrcItem) : |
50 | Parser(File,SrcItem), | |
11e7af84 AL |
51 | Tags(*File,sizeof(Buffer)) {}; |
52 | }; | |
53 | ||
54 | #endif |