]>
git.saurik.com Git - apt.git/blob - apt-pkg/deb/deblistparser.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: deblistparser.h,v 1.3 1998/07/05 05:34:01 jgg Exp $
4 /* ######################################################################
6 Debian Package List Parser - This implements the abstract parser
7 interface for Debian package files
9 ##################################################################### */
11 // Header section: pkglib
12 #ifndef PKGLIB_DEBLISTPARSER_H
13 #define PKGLIB_DEBLISTPARSER_H
15 #include <pkglib/pkgcachegen.h>
16 #include <pkglib/tagfile.h>
18 class debListParser
: public pkgCacheGenerator::ListParser
21 pkgTagSection Section
;
22 unsigned long iOffset
;
31 string
FindTag(const char *Tag
);
32 signed long FindTagI(const char *Tag
,signed long Default
= 0);
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
);
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
,
40 bool ParseProvides(pkgCache::VerIterator Ver
);
41 bool GrabWord(string Word
,WordList
*List
,int Count
,unsigned char &Out
);
45 // These all operate against the current section
46 virtual string
Package();
47 virtual string
Version();
48 virtual bool NewVersion(pkgCache::VerIterator Ver
);
49 virtual bool UsePackage(pkgCache::PkgIterator Pkg
,
50 pkgCache::VerIterator Ver
);
51 virtual unsigned long Offset() {return iOffset
;};
52 virtual unsigned long Size() {return Section
.size();};
56 debListParser(File
&File
);