]> git.saurik.com Git - apt.git/blame - apt-pkg/deb/deblistparser.h
apt-pkg/deb/*: add placeholder dpointer and make destructors virtual
[apt.git] / apt-pkg / deb / deblistparser.h
CommitLineData
f55a958f
AL
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
b2e465d6 3// $Id: deblistparser.h,v 1.9 2001/02/20 07:03:17 jgg Exp $
f55a958f
AL
4/* ######################################################################
5
6 Debian Package List Parser - This implements the abstract parser
7 interface for Debian package files
8
9 ##################################################################### */
10 /*}}}*/
f55a958f
AL
11#ifndef PKGLIB_DEBLISTPARSER_H
12#define PKGLIB_DEBLISTPARSER_H
13
094a497d 14#include <apt-pkg/pkgcachegen.h>
a52f938b 15#include <apt-pkg/indexfile.h>
094a497d 16#include <apt-pkg/tagfile.h>
f55a958f
AL
17
18class debListParser : public pkgCacheGenerator::ListParser
19{
b2e465d6
AL
20 public:
21
f55a958f
AL
22 // Parser Helper
23 struct WordList
24 {
b2e465d6 25 const char *Str;
f55a958f
AL
26 unsigned char Val;
27 };
28
b2e465d6 29 private:
ff72bd0d
MV
30 /** \brief dpointer placeholder (for later in case we need it) */
31 void *d;
b2e465d6
AL
32
33 pkgTagFile Tags;
34 pkgTagSection Section;
35 unsigned long iOffset;
36 string Arch;
dcfa253f
DK
37 std::vector<std::string> Architectures;
38 bool MultiArchEnabled;
39
f55a958f 40 unsigned long UniqFindTagWrite(const char *Tag);
32b9a14c
DK
41 bool ParseStatus(pkgCache::PkgIterator &Pkg,pkgCache::VerIterator &Ver);
42 bool ParseDepends(pkgCache::VerIterator &Ver,const char *Tag,
dcb79bae 43 unsigned int Type);
32b9a14c 44 bool ParseProvides(pkgCache::VerIterator &Ver);
b2e465d6 45 static bool GrabWord(string Word,WordList *List,unsigned char &Out);
f55a958f
AL
46
47 public:
b2e465d6
AL
48
49 static unsigned char GetPrio(string Str);
50
f55a958f
AL
51 // These all operate against the current section
52 virtual string Package();
5bf15716 53 virtual string Architecture();
857e9c13 54 virtual bool ArchitectureAll();
f55a958f 55 virtual string Version();
32b9a14c 56 virtual bool NewVersion(pkgCache::VerIterator &Ver);
a52f938b
OS
57 virtual string Description();
58 virtual string DescriptionLanguage();
59 virtual MD5SumValue Description_md5();
204fbdcc 60 virtual unsigned short VersionHash();
32b9a14c
DK
61 virtual bool UsePackage(pkgCache::PkgIterator &Pkg,
62 pkgCache::VerIterator &Ver);
dcb79bae
AL
63 virtual unsigned long Offset() {return iOffset;};
64 virtual unsigned long Size() {return Section.size();};
f55a958f
AL
65
66 virtual bool Step();
b2e465d6 67
32b9a14c 68 bool LoadReleaseInfo(pkgCache::PkgFileIterator &FileI,FileFd &File,
e011829d 69 string section);
f55a958f 70
b2e465d6
AL
71 static const char *ParseDepends(const char *Start,const char *Stop,
72 string &Package,string &Ver,unsigned int &Op,
41c81fd8
DK
73 bool const &ParseArchFlags = false,
74 bool const &StripMultiArch = false);
b2e465d6
AL
75 static const char *ConvertRelation(const char *I,unsigned int &Op);
76
5dd4c8b8 77 debListParser(FileFd *File, string const &Arch = "");
ff72bd0d 78 virtual ~debListParser() {};
f55a958f
AL
79};
80
81#endif