]> git.saurik.com Git - apt.git/blame - apt-pkg/deb/deblistparser.h
* [BREAK] merged lp:~mvo/apt/history
[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
AL
29 private:
30
31 pkgTagFile Tags;
32 pkgTagSection Section;
33 unsigned long iOffset;
34 string Arch;
35
f55a958f 36 unsigned long UniqFindTagWrite(const char *Tag);
f55a958f 37 bool ParseStatus(pkgCache::PkgIterator Pkg,pkgCache::VerIterator Ver);
dcb79bae
AL
38 bool ParseDepends(pkgCache::VerIterator Ver,const char *Tag,
39 unsigned int Type);
40 bool ParseProvides(pkgCache::VerIterator Ver);
b2e465d6 41 static bool GrabWord(string Word,WordList *List,unsigned char &Out);
f55a958f
AL
42
43 public:
b2e465d6
AL
44
45 static unsigned char GetPrio(string Str);
46
f55a958f
AL
47 // These all operate against the current section
48 virtual string Package();
49 virtual string Version();
50 virtual bool NewVersion(pkgCache::VerIterator Ver);
a52f938b
OS
51 virtual string Description();
52 virtual string DescriptionLanguage();
53 virtual MD5SumValue Description_md5();
204fbdcc 54 virtual unsigned short VersionHash();
f55a958f
AL
55 virtual bool UsePackage(pkgCache::PkgIterator Pkg,
56 pkgCache::VerIterator Ver);
dcb79bae
AL
57 virtual unsigned long Offset() {return iOffset;};
58 virtual unsigned long Size() {return Section.size();};
f55a958f
AL
59
60 virtual bool Step();
b2e465d6 61
e011829d
MV
62 bool LoadReleaseInfo(pkgCache::PkgFileIterator FileI,FileFd &File,
63 string section);
f55a958f 64
b2e465d6
AL
65 static const char *ParseDepends(const char *Start,const char *Stop,
66 string &Package,string &Ver,unsigned int &Op,
41c81fd8
DK
67 bool const &ParseArchFlags = false,
68 bool const &StripMultiArch = false);
b2e465d6
AL
69 static const char *ConvertRelation(const char *I,unsigned int &Op);
70
71 debListParser(FileFd *File);
f55a958f
AL
72};
73
74#endif