]>
Commit | Line | Data |
---|---|---|
f55a958f AL |
1 | // -*- mode: cpp; mode: fold -*- |
2 | // Description /*{{{*/ | |
094a497d | 3 | // $Id: deblistparser.h,v 1.4 1998/07/12 23:58:54 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 | /*}}}*/ | |
11 | // Header section: pkglib | |
12 | #ifndef PKGLIB_DEBLISTPARSER_H | |
13 | #define PKGLIB_DEBLISTPARSER_H | |
14 | ||
094a497d AL |
15 | #include <apt-pkg/pkgcachegen.h> |
16 | #include <apt-pkg/tagfile.h> | |
f55a958f AL |
17 | |
18 | class debListParser : public pkgCacheGenerator::ListParser | |
19 | { | |
20 | pkgTagFile Tags; | |
21 | pkgTagSection Section; | |
dcb79bae | 22 | unsigned long iOffset; |
f55a958f AL |
23 | |
24 | // Parser Helper | |
25 | struct WordList | |
26 | { | |
27 | char *Str; | |
28 | unsigned char Val; | |
29 | }; | |
30 | ||
31 | string FindTag(const char *Tag); | |
0149949b | 32 | signed long FindTagI(const char *Tag,signed long Default = 0); |
f55a958f AL |
33 | unsigned long UniqFindTagWrite(const char *Tag); |
34 | bool HandleFlag(const char *Tag,unsigned long &Flags,unsigned long Flag); | |
35 | bool ParseStatus(pkgCache::PkgIterator Pkg,pkgCache::VerIterator Ver); | |
dcb79bae AL |
36 | const char *ParseDepends(const char *Start,const char *Stop, |
37 | string &Package,string &Ver,unsigned int &Op); | |
38 | bool ParseDepends(pkgCache::VerIterator Ver,const char *Tag, | |
39 | unsigned int Type); | |
40 | bool ParseProvides(pkgCache::VerIterator Ver); | |
f55a958f AL |
41 | bool GrabWord(string Word,WordList *List,int Count,unsigned char &Out); |
42 | ||
43 | public: | |
44 | ||
45 | // These all operate against the current section | |
46 | virtual string Package(); | |
47 | virtual string Version(); | |
48 | virtual bool NewVersion(pkgCache::VerIterator Ver); | |
f55a958f AL |
49 | virtual bool UsePackage(pkgCache::PkgIterator Pkg, |
50 | pkgCache::VerIterator Ver); | |
dcb79bae AL |
51 | virtual unsigned long Offset() {return iOffset;}; |
52 | virtual unsigned long Size() {return Section.size();}; | |
f55a958f AL |
53 | |
54 | virtual bool Step(); | |
55 | ||
56 | debListParser(File &File); | |
57 | }; | |
58 | ||
59 | #endif |