]> git.saurik.com Git - apt.git/blob - apt-pkg/deb/deblistparser.h
a458eb60cfbb2046fd7d4a79aa7d0946d21d0e6f
[apt.git] / apt-pkg / deb / deblistparser.h
1 // -*- mode: cpp; mode: fold -*-
2 // Description /*{{{*/
3 // $Id: deblistparser.h,v 1.2 1998/07/04 22:32:18 jgg Exp $
4 /* ######################################################################
5
6 Debian Package List Parser - This implements the abstract parser
7 interface for Debian package files
8
9 ##################################################################### */
10 /*}}}*/
11 // Header section: pkglib
12 #ifndef PKGLIB_DEBLISTPARSER_H
13 #define PKGLIB_DEBLISTPARSER_H
14
15 #include <pkglib/pkgcachegen.h>
16 #include <pkglib/tagfile.h>
17
18 class debListParser : public pkgCacheGenerator::ListParser
19 {
20 pkgTagFile Tags;
21 pkgTagSection Section;
22
23 // Parser Helper
24 struct WordList
25 {
26 char *Str;
27 unsigned char Val;
28 };
29
30 string FindTag(const char *Tag);
31 signed long FindTagI(const char *Tag,signed long Default = 0);
32 unsigned long UniqFindTagWrite(const char *Tag);
33 bool HandleFlag(const char *Tag,unsigned long &Flags,unsigned long Flag);
34 bool ParseStatus(pkgCache::PkgIterator Pkg,pkgCache::VerIterator Ver);
35 bool GrabWord(string Word,WordList *List,int Count,unsigned char &Out);
36
37 public:
38
39 // These all operate against the current section
40 virtual string Package();
41 virtual string Version();
42 virtual bool NewVersion(pkgCache::VerIterator Ver);
43 virtual bool NewPackage(pkgCache::PkgIterator Pkg);
44 virtual bool UsePackage(pkgCache::PkgIterator Pkg,
45 pkgCache::VerIterator Ver);
46
47 virtual bool Step();
48
49 debListParser(File &File);
50 };
51
52 #endif