]>
Commit | Line | Data |
---|---|---|
f55a958f AL |
1 | // -*- mode: cpp; mode: fold -*- |
2 | // Description /*{{{*/ | |
b0b4efb9 | 3 | // $Id: deblistparser.h,v 1.6 1998/12/14 02:23:47 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 | ||
f55a958f | 31 | unsigned long UniqFindTagWrite(const char *Tag); |
f55a958f | 32 | bool ParseStatus(pkgCache::PkgIterator Pkg,pkgCache::VerIterator Ver); |
dcb79bae AL |
33 | const char *ParseDepends(const char *Start,const char *Stop, |
34 | string &Package,string &Ver,unsigned int &Op); | |
35 | bool ParseDepends(pkgCache::VerIterator Ver,const char *Tag, | |
36 | unsigned int Type); | |
37 | bool ParseProvides(pkgCache::VerIterator Ver); | |
f55a958f AL |
38 | bool GrabWord(string Word,WordList *List,int Count,unsigned char &Out); |
39 | ||
40 | public: | |
41 | ||
42 | // These all operate against the current section | |
43 | virtual string Package(); | |
44 | virtual string Version(); | |
45 | virtual bool NewVersion(pkgCache::VerIterator Ver); | |
f55a958f AL |
46 | virtual bool UsePackage(pkgCache::PkgIterator Pkg, |
47 | pkgCache::VerIterator Ver); | |
dcb79bae AL |
48 | virtual unsigned long Offset() {return iOffset;}; |
49 | virtual unsigned long Size() {return Section.size();}; | |
f55a958f AL |
50 | |
51 | virtual bool Step(); | |
b0b4efb9 AL |
52 | |
53 | bool LoadReleaseInfo(pkgCache::PkgFileIterator FileI,FileFd &File); | |
f55a958f | 54 | |
8e06abb2 | 55 | debListParser(FileFd &File); |
f55a958f AL |
56 | }; |
57 | ||
58 | #endif |