]>
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/indexfile.h>
16 #include <apt-pkg/tagfile.h>
18 class debListParser
: public pkgCacheGenerator::ListParser
32 pkgTagSection Section
;
33 unsigned long iOffset
;
36 unsigned long UniqFindTagWrite(const char *Tag
);
37 bool ParseStatus(pkgCache::PkgIterator Pkg
,pkgCache::VerIterator Ver
);
38 bool ParseDepends(pkgCache::VerIterator Ver
,const char *Tag
,
40 bool ParseProvides(pkgCache::VerIterator Ver
);
41 static bool GrabWord(string Word
,WordList
*List
,unsigned char &Out
);
45 static unsigned char GetPrio(string Str
);
47 // These all operate against the current section
48 virtual string
Package();
49 virtual string
Architecture();
50 virtual bool ArchitectureAll();
51 virtual string
Version();
52 virtual bool NewVersion(pkgCache::VerIterator Ver
);
53 virtual string
Description();
54 virtual string
DescriptionLanguage();
55 virtual MD5SumValue
Description_md5();
56 virtual unsigned short VersionHash();
57 virtual bool UsePackage(pkgCache::PkgIterator Pkg
,
58 pkgCache::VerIterator Ver
);
59 virtual unsigned long Offset() {return iOffset
;};
60 virtual unsigned long Size() {return Section
.size();};
64 bool LoadReleaseInfo(pkgCache::PkgFileIterator FileI
,FileFd
&File
,
67 static const char *ParseDepends(const char *Start
,const char *Stop
,
68 string
&Package
,string
&Ver
,unsigned int &Op
,
69 bool const &ParseArchFlags
= false,
70 bool const &StripMultiArch
= false);
71 static const char *ConvertRelation(const char *I
,unsigned int &Op
);
73 debListParser(FileFd
*File
, string
const &Arch
= "");