convert getlanguages_test to our new equals()
[ntk/apt.git] / apt-pkg / deb / debsrcrecords.h
CommitLineData
11e7af84
AL
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
c33b707e 3// $Id: debsrcrecords.h,v 1.8 2004/03/17 05:58:54 mdz 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
11e7af84
AL
14
15#include <apt-pkg/srcrecords.h>
16#include <apt-pkg/tagfile.h>
b2e465d6 17#include <apt-pkg/fileutl.h>
11e7af84
AL
18
19class debSrcRecordParser : public pkgSrcRecords::Parser
20{
b2e465d6 21 FileFd Fd;
11e7af84
AL
22 pkgTagFile Tags;
23 pkgTagSection Sect;
b2e465d6 24 char *StaticBinList[400];
11e7af84 25 unsigned long iOffset;
4ab24e53 26 char *Buffer;
19ec5723 27 unsigned int BufSize;
11e7af84
AL
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
b2e465d6
AL
35 virtual string Package() const {return Sect.FindS("Package");};
36 virtual string Version() const {return Sect.FindS("Version");};
37 virtual string Maintainer() const {return Sect.FindS("Maintainer");};
38 virtual string Section() const {return Sect.FindS("Section");};
11e7af84 39 virtual const char **Binaries();
45430cbf 40 virtual bool BuildDepends(vector<BuildDepRec> &BuildDeps, bool ArchOnly);
11e7af84 41 virtual unsigned long Offset() {return iOffset;};
f8f410f5
AL
42 virtual string AsStr()
43 {
aaee8293 44 const char *Start=0,*Stop=0;
f8f410f5
AL
45 Sect.GetSection(Start,Stop);
46 return string(Start,Stop);
47 };
36f610f1 48 virtual bool Files(vector<pkgSrcRecords::File> &F);
b2e465d6 49
4ab24e53
MV
50 debSrcRecordParser(string File,pkgIndexFile const *Index)
51 : Parser(Index), Fd(File,FileFd::ReadOnly), Tags(&Fd,102400),
52 Buffer(0), BufSize(0) {}
7a9f09bd 53 ~debSrcRecordParser();
11e7af84
AL
54};
55
56#endif