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