]>
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
30 /** \brief dpointer placeholder (for later in case we need it) */
34 pkgTagSection Section
;
35 unsigned long iOffset
;
37 std::vector
<std::string
> Architectures
;
38 bool MultiArchEnabled
;
40 unsigned long UniqFindTagWrite(const char *Tag
);
41 bool ParseStatus(pkgCache::PkgIterator
&Pkg
,pkgCache::VerIterator
&Ver
);
42 bool ParseDepends(pkgCache::VerIterator
&Ver
,const char *Tag
,
44 bool ParseProvides(pkgCache::VerIterator
&Ver
);
45 static bool GrabWord(string Word
,WordList
*List
,unsigned char &Out
);
49 static unsigned char GetPrio(string Str
);
51 // These all operate against the current section
52 virtual string
Package();
53 virtual string
Architecture();
54 virtual bool ArchitectureAll();
55 virtual string
Version();
56 virtual bool NewVersion(pkgCache::VerIterator
&Ver
);
57 virtual string
Description();
58 virtual string
DescriptionLanguage();
59 virtual MD5SumValue
Description_md5();
60 virtual unsigned short VersionHash();
61 virtual bool UsePackage(pkgCache::PkgIterator
&Pkg
,
62 pkgCache::VerIterator
&Ver
);
63 virtual unsigned long Offset() {return iOffset
;};
64 virtual unsigned long Size() {return Section
.size();};
68 bool LoadReleaseInfo(pkgCache::PkgFileIterator
&FileI
,FileFd
&File
,
71 static const char *ParseDepends(const char *Start
,const char *Stop
,
72 string
&Package
,string
&Ver
,unsigned int &Op
,
73 bool const &ParseArchFlags
= false,
74 bool const &StripMultiArch
= false);
75 static const char *ConvertRelation(const char *I
,unsigned int &Op
);
77 debListParser(FileFd
*File
, string
const &Arch
= "");
78 virtual ~debListParser() {};