]> git.saurik.com Git - apt.git/blame - apt-pkg/deb/debsrcrecords.h
* apt-pkg/algorithms.cc:
[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{
ff72bd0d
MV
21 /** \brief dpointer placeholder (for later in case we need it) */
22 void *d;
23
b2e465d6 24 FileFd Fd;
11e7af84
AL
25 pkgTagFile Tags;
26 pkgTagSection Sect;
b2e465d6 27 char *StaticBinList[400];
11e7af84 28 unsigned long iOffset;
4ab24e53 29 char *Buffer;
19ec5723 30 unsigned int BufSize;
11e7af84
AL
31
32 public:
33
34 virtual bool Restart() {return Tags.Jump(Sect,0);};
35 virtual bool Step() {iOffset = Tags.Offset(); return Tags.Step(Sect);};
41c81fd8 36 virtual bool Jump(unsigned long const &Off) {iOffset = Off; return Tags.Jump(Sect,Off);};
11e7af84 37
8f3ba4e8
DK
38 virtual std::string Package() const {return Sect.FindS("Package");};
39 virtual std::string Version() const {return Sect.FindS("Version");};
40 virtual std::string Maintainer() const {return Sect.FindS("Maintainer");};
41 virtual std::string Section() const {return Sect.FindS("Section");};
11e7af84 42 virtual const char **Binaries();
8f3ba4e8 43 virtual bool BuildDepends(std::vector<BuildDepRec> &BuildDeps, bool const &ArchOnly, bool const &StripMultiArch = true);
11e7af84 44 virtual unsigned long Offset() {return iOffset;};
8f3ba4e8 45 virtual std::string AsStr()
f8f410f5 46 {
aaee8293 47 const char *Start=0,*Stop=0;
f8f410f5 48 Sect.GetSection(Start,Stop);
8f3ba4e8 49 return std::string(Start,Stop);
f8f410f5 50 };
8f3ba4e8 51 virtual bool Files(std::vector<pkgSrcRecords::File> &F);
b2e465d6 52
8f3ba4e8 53 debSrcRecordParser(std::string const &File,pkgIndexFile const *Index)
c4fc2fd7 54 : Parser(Index), Fd(File,FileFd::ReadOnlyGzip), Tags(&Fd,102400),
4ab24e53 55 Buffer(0), BufSize(0) {}
ff72bd0d 56 virtual ~debSrcRecordParser();
11e7af84
AL
57};
58
59#endif