]> git.saurik.com Git - apt-legacy.git/blame - apt-pkg/deb/deblistparser.h
Add /etc/apt/preferences.d.
[apt-legacy.git] / apt-pkg / deb / deblistparser.h
CommitLineData
da6ee469
JF
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
3// $Id: deblistparser.h,v 1.9 2001/02/20 07:03:17 jgg Exp $
4/* ######################################################################
5
6 Debian Package List Parser - This implements the abstract parser
7 interface for Debian package files
8
9 ##################################################################### */
10 /*}}}*/
11#ifndef PKGLIB_DEBLISTPARSER_H
12#define PKGLIB_DEBLISTPARSER_H
13
14#include <apt-pkg/pkgcachegen.h>
00ec24d0 15#include <apt-pkg/indexfile.h>
da6ee469
JF
16#include <apt-pkg/tagfile.h>
17
18class debListParser : public pkgCacheGenerator::ListParser
19{
20 public:
21
22 // Parser Helper
23 struct WordList
24 {
25 const char *Str;
26 unsigned char Val;
27 };
28
29 private:
30
31 pkgTagFile Tags;
32 pkgTagSection Section;
33 unsigned long iOffset;
34 string Arch;
35
5022530b 36 unsigned long FindTagWrite(const char *Tag);
da6ee469
JF
37 unsigned long UniqFindTagWrite(const char *Tag);
38 bool ParseStatus(pkgCache::PkgIterator Pkg,pkgCache::VerIterator Ver);
39 bool ParseDepends(pkgCache::VerIterator Ver,const char *Tag,
40 unsigned int Type);
41 bool ParseProvides(pkgCache::VerIterator Ver);
acdafb44 42 bool ParseTag(pkgCache::PkgIterator Pkg);
da6ee469
JF
43 static bool GrabWord(string Word,WordList *List,unsigned char &Out);
44
45 public:
46
47 static unsigned char GetPrio(string Str);
48
49 // These all operate against the current section
50 virtual string Package();
51 virtual string Version();
52 virtual bool NewVersion(pkgCache::VerIterator Ver);
00ec24d0
JF
53 virtual string Description();
54 virtual string DescriptionLanguage();
55 virtual MD5SumValue Description_md5();
da6ee469
JF
56 virtual unsigned short VersionHash();
57 virtual bool UsePackage(pkgCache::PkgIterator Pkg,
58 pkgCache::VerIterator Ver);
59 virtual unsigned long Offset() {return iOffset;};
60 virtual unsigned long Size() {return Section.size();};
61
62 virtual bool Step();
63
64 bool LoadReleaseInfo(pkgCache::PkgFileIterator FileI,FileFd &File,
65 string section);
66
67 static const char *ParseDepends(const char *Start,const char *Stop,
68 string &Package,string &Ver,unsigned int &Op,
69 bool ParseArchFlags = false);
70 static const char *ConvertRelation(const char *I,unsigned int &Op);
71
72 debListParser(FileFd *File);
73};
74
75#endif