]> git.saurik.com Git - apt.git/blame - apt-pkg/deb/debsrcrecords.h
* cmdline/apt-mark:
[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
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>
b2e465d6 20#include <apt-pkg/fileutl.h>
11e7af84
AL
21
22class debSrcRecordParser : public pkgSrcRecords::Parser
23{
b2e465d6 24 FileFd Fd;
11e7af84
AL
25 pkgTagFile Tags;
26 pkgTagSection Sect;
27 char Buffer[10000];
b2e465d6 28 char *StaticBinList[400];
11e7af84
AL
29 unsigned long iOffset;
30
31 public:
32
33 virtual bool Restart() {return Tags.Jump(Sect,0);};
34 virtual bool Step() {iOffset = Tags.Offset(); return Tags.Step(Sect);};
35 virtual bool Jump(unsigned long Off) {iOffset = Off; return Tags.Jump(Sect,Off);};
36
b2e465d6
AL
37 virtual string Package() const {return Sect.FindS("Package");};
38 virtual string Version() const {return Sect.FindS("Version");};
39 virtual string Maintainer() const {return Sect.FindS("Maintainer");};
40 virtual string Section() const {return Sect.FindS("Section");};
11e7af84 41 virtual const char **Binaries();
45430cbf 42 virtual bool BuildDepends(vector<BuildDepRec> &BuildDeps, bool ArchOnly);
11e7af84 43 virtual unsigned long Offset() {return iOffset;};
f8f410f5
AL
44 virtual string AsStr()
45 {
aaee8293 46 const char *Start=0,*Stop=0;
f8f410f5
AL
47 Sect.GetSection(Start,Stop);
48 return string(Start,Stop);
49 };
36f610f1 50 virtual bool Files(vector<pkgSrcRecords::File> &F);
b2e465d6
AL
51
52 debSrcRecordParser(string File,pkgIndexFile const *Index) :
53 Parser(Index),
54 Fd(File,FileFd::ReadOnly),
c33b707e 55 Tags(&Fd,102400) {};
11e7af84
AL
56};
57
58#endif