]> git.saurik.com Git - apt.git/blob - apt-pkg/deb/debsrcrecords.h
* removed the pragma mess
[apt.git] / apt-pkg / deb / debsrcrecords.h
1 // -*- mode: cpp; mode: fold -*-
2 // Description /*{{{*/
3 // $Id: debsrcrecords.h,v 1.8 2004/03/17 05:58:54 mdz Exp $
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
15 #include <apt-pkg/srcrecords.h>
16 #include <apt-pkg/tagfile.h>
17 #include <apt-pkg/fileutl.h>
18
19 class debSrcRecordParser : public pkgSrcRecords::Parser
20 {
21 FileFd Fd;
22 pkgTagFile Tags;
23 pkgTagSection Sect;
24 char Buffer[10000];
25 char *StaticBinList[400];
26 unsigned long iOffset;
27
28 public:
29
30 virtual bool Restart() {return Tags.Jump(Sect,0);};
31 virtual bool Step() {iOffset = Tags.Offset(); return Tags.Step(Sect);};
32 virtual bool Jump(unsigned long Off) {iOffset = Off; return Tags.Jump(Sect,Off);};
33
34 virtual string Package() const {return Sect.FindS("Package");};
35 virtual string Version() const {return Sect.FindS("Version");};
36 virtual string Maintainer() const {return Sect.FindS("Maintainer");};
37 virtual string Section() const {return Sect.FindS("Section");};
38 virtual const char **Binaries();
39 virtual bool BuildDepends(vector<BuildDepRec> &BuildDeps, bool ArchOnly);
40 virtual unsigned long Offset() {return iOffset;};
41 virtual string AsStr()
42 {
43 const char *Start=0,*Stop=0;
44 Sect.GetSection(Start,Stop);
45 return string(Start,Stop);
46 };
47 virtual bool Files(vector<pkgSrcRecords::File> &F);
48
49 debSrcRecordParser(string File,pkgIndexFile const *Index) :
50 Parser(Index),
51 Fd(File,FileFd::ReadOnly),
52 Tags(&Fd,102400) {};
53 };
54
55 #endif