]> git.saurik.com Git - apt.git/blame - apt-pkg/deb/deblistparser.h
Join with aliencode
[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
AL
14#include <apt-pkg/pkgcachegen.h>
15#include <apt-pkg/tagfile.h>
f55a958f
AL
16
17class debListParser : public pkgCacheGenerator::ListParser
18{
b2e465d6
AL
19 public:
20
f55a958f
AL
21 // Parser Helper
22 struct WordList
23 {
b2e465d6 24 const char *Str;
f55a958f
AL
25 unsigned char Val;
26 };
27
b2e465d6
AL
28 private:
29
30 pkgTagFile Tags;
31 pkgTagSection Section;
32 unsigned long iOffset;
33 string Arch;
34
f55a958f 35 unsigned long UniqFindTagWrite(const char *Tag);
f55a958f 36 bool ParseStatus(pkgCache::PkgIterator Pkg,pkgCache::VerIterator Ver);
dcb79bae
AL
37 bool ParseDepends(pkgCache::VerIterator Ver,const char *Tag,
38 unsigned int Type);
39 bool ParseProvides(pkgCache::VerIterator Ver);
b2e465d6 40 static bool GrabWord(string Word,WordList *List,unsigned char &Out);
f55a958f
AL
41
42 public:
b2e465d6
AL
43
44 static unsigned char GetPrio(string Str);
45
f55a958f
AL
46 // These all operate against the current section
47 virtual string Package();
48 virtual string Version();
49 virtual bool NewVersion(pkgCache::VerIterator Ver);
204fbdcc 50 virtual unsigned short VersionHash();
f55a958f
AL
51 virtual bool UsePackage(pkgCache::PkgIterator Pkg,
52 pkgCache::VerIterator Ver);
dcb79bae
AL
53 virtual unsigned long Offset() {return iOffset;};
54 virtual unsigned long Size() {return Section.size();};
f55a958f
AL
55
56 virtual bool Step();
b2e465d6 57
b0b4efb9 58 bool LoadReleaseInfo(pkgCache::PkgFileIterator FileI,FileFd &File);
f55a958f 59
b2e465d6
AL
60 static const char *ParseDepends(const char *Start,const char *Stop,
61 string &Package,string &Ver,unsigned int &Op,
62 bool ParseArchFlags = false);
63 static const char *ConvertRelation(const char *I,unsigned int &Op);
64
65 debListParser(FileFd *File);
f55a958f
AL
66};
67
68#endif