]> git.saurik.com Git - apt.git/blame - apt-pkg/deb/debsrcrecords.h
Revert "Fix select timeout to be 50msec instead of 0.5msec" for acquire
[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#include <apt-pkg/srcrecords.h>
15#include <apt-pkg/tagfile.h>
b2e465d6 16#include <apt-pkg/fileutl.h>
11e7af84 17
453b82a3
DK
18#include <stddef.h>
19#include <string>
20#include <vector>
21
22class pkgIndexFile;
23
dce45dbe 24class APT_HIDDEN debSrcRecordParser : public pkgSrcRecords::Parser
11e7af84 25{
ff72bd0d 26 /** \brief dpointer placeholder (for later in case we need it) */
6c55f07a 27 void * const d;
ff72bd0d 28
feab34c5 29 protected:
b2e465d6 30 FileFd Fd;
11e7af84
AL
31 pkgTagFile Tags;
32 pkgTagSection Sect;
39fb1e24 33 std::vector<const char*> StaticBinList;
11e7af84 34 unsigned long iOffset;
4ab24e53 35 char *Buffer;
11e7af84
AL
36
37 public:
38
3b302846
DK
39 virtual bool Restart() APT_OVERRIDE {return Jump(0);};
40 virtual bool Step() APT_OVERRIDE {iOffset = Tags.Offset(); return Tags.Step(Sect);};
41 virtual bool Jump(unsigned long const &Off) APT_OVERRIDE {iOffset = Off; return Tags.Jump(Sect,Off);};
11e7af84 42
3b302846
DK
43 virtual std::string Package() const APT_OVERRIDE {return Sect.FindS("Package");};
44 virtual std::string Version() const APT_OVERRIDE {return Sect.FindS("Version");};
45 virtual std::string Maintainer() const APT_OVERRIDE {return Sect.FindS("Maintainer");};
46 virtual std::string Section() const APT_OVERRIDE {return Sect.FindS("Section");};
47 virtual const char **Binaries() APT_OVERRIDE;
48 virtual bool BuildDepends(std::vector<BuildDepRec> &BuildDeps, bool const &ArchOnly, bool const &StripMultiArch = true) APT_OVERRIDE;
49 virtual unsigned long Offset() APT_OVERRIDE {return iOffset;};
50 virtual std::string AsStr() APT_OVERRIDE
f8f410f5 51 {
aaee8293 52 const char *Start=0,*Stop=0;
f8f410f5 53 Sect.GetSection(Start,Stop);
8f3ba4e8 54 return std::string(Start,Stop);
f8f410f5 55 };
3b302846 56 virtual bool Files(std::vector<pkgSrcRecords::File> &F) APT_OVERRIDE;
3a2b39ee 57 bool Files2(std::vector<pkgSrcRecords::File2> &F);
b2e465d6 58
c8a4ce6c 59 debSrcRecordParser(std::string const &File,pkgIndexFile const *Index);
ff72bd0d 60 virtual ~debSrcRecordParser();
11e7af84
AL
61};
62
dce45dbe 63class APT_HIDDEN debDscRecordParser : public debSrcRecordParser
feab34c5
MV
64{
65 public:
a49e7948 66 debDscRecordParser(std::string const &DscFile, pkgIndexFile const *Index);
feab34c5
MV
67};
68
11e7af84 69#endif