]>
git.saurik.com Git - apt-legacy.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/indexfile.h>
16 #include <apt-pkg/tagfile.h>
18 class debListParser
: public pkgCacheGenerator::ListParser
32 pkgTagSection Section
;
33 unsigned long iOffset
;
36 unsigned long FindTagWrite(const char *Tag
);
37 unsigned long UniqFindTagWrite(const char *Tag
);
38 bool ParseStatus(pkgCache::PkgIterator Pkg
,pkgCache::VerIterator Ver
);
39 bool ParseDepends(pkgCache::VerIterator Ver
,const char *Tag
,
41 bool ParseProvides(pkgCache::VerIterator Ver
);
42 bool ParseTag(pkgCache::PkgIterator Pkg
);
43 static bool GrabWord(string Word
,WordList
*List
,unsigned char &Out
);
44 static bool GrabWord(const srkString
&Word
,WordList
*List
,unsigned char &Out
);
48 srkString
Find(const char *Tag
) {
51 if (Section
.Find(Tag
, S
.Start
, Stop
))
52 S
.Size
= Stop
- S
.Start
;
60 static unsigned char GetPrio(string Str
);
62 // These all operate against the current section
63 virtual string
Package();
64 virtual string
Version();
65 virtual bool NewVersion(pkgCache::VerIterator Ver
);
66 virtual string
Description();
67 void Description(srkString
&Str
);
68 virtual string
DescriptionLanguage();
69 virtual MD5SumValue
Description_md5();
70 virtual unsigned short VersionHash();
71 virtual bool UsePackage(pkgCache::PkgIterator Pkg
,
72 pkgCache::VerIterator Ver
);
73 virtual unsigned long Offset() {return iOffset
;};
74 virtual unsigned long Size() {return Section
.size();};
78 bool LoadReleaseInfo(pkgCache::PkgFileIterator FileI
,FileFd
&File
,
81 static const char *ParseDepends(const char *Start
,const char *Stop
,
82 string
&Package
,string
&Ver
,unsigned int &Op
,
83 bool ParseArchFlags
= false);
84 static const char *ParseDepends(const char *Start
,const char *Stop
,
85 srkString
&Package
,srkString
&Ver
,unsigned int &Op
,
86 bool ParseArchFlags
= false);
87 static const char *ConvertRelation(const char *I
,unsigned int &Op
);
89 debListParser(FileFd
*File
);