]>
git.saurik.com Git - apt.git/blob - apt-pkg/deb/deblistparser.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: deblistparser.h,v 1.9 2001/02/20 07:03:17 jgg Exp $
4 /* ######################################################################
6 Debian Package List Parser - This implements the abstract parser
7 interface for Debian package files
9 ##################################################################### */
11 #ifndef PKGLIB_DEBLISTPARSER_H
12 #define PKGLIB_DEBLISTPARSER_H
14 #include <apt-pkg/pkgcachegen.h>
15 #include <apt-pkg/tagfile.h>
17 class debListParser
: public pkgCacheGenerator::ListParser
31 pkgTagSection Section
;
32 unsigned long iOffset
;
35 unsigned long UniqFindTagWrite(const char *Tag
);
36 bool ParseStatus(pkgCache::PkgIterator Pkg
,pkgCache::VerIterator Ver
);
37 bool ParseDepends(pkgCache::VerIterator Ver
,const char *Tag
,
39 bool ParseProvides(pkgCache::VerIterator Ver
);
40 static bool GrabWord(string Word
,WordList
*List
,unsigned char &Out
);
44 static unsigned char GetPrio(string Str
);
46 // These all operate against the current section
47 virtual string
Package();
48 virtual string
Version();
49 virtual bool NewVersion(pkgCache::VerIterator Ver
);
50 virtual unsigned short VersionHash();
51 virtual bool UsePackage(pkgCache::PkgIterator Pkg
,
52 pkgCache::VerIterator Ver
);
53 virtual unsigned long Offset() {return iOffset
;};
54 virtual unsigned long Size() {return Section
.size();};
58 bool LoadReleaseInfo(pkgCache::PkgFileIterator FileI
,FileFd
&File
,
61 static const char *ParseDepends(const char *Start
,const char *Stop
,
62 string
&Package
,string
&Ver
,unsigned int &Op
,
63 bool ParseArchFlags
= false);
64 static const char *ConvertRelation(const char *I
,unsigned int &Op
);
66 debListParser(FileFd
*File
);