]>
git.saurik.com Git - apt.git/blob - apt-pkg/deb/deblistparser.h
9519d9711e42c7bf1cd7bb913dd17068943f222c
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
29 /** \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 virtual bool ParseStatus(pkgCache::PkgIterator
&Pkg
,pkgCache::VerIterator
&Ver
);
42 bool ParseDepends(pkgCache::VerIterator
&Ver
,const char *Tag
,
44 bool ParseProvides(pkgCache::VerIterator
&Ver
);
45 bool NewProvidesAllArch(pkgCache::VerIterator
&Ver
, std::string
const &Package
, std::string
const &Version
);
46 static bool GrabWord(std::string Word
,WordList
*List
,unsigned char &Out
);
50 static unsigned char GetPrio(std::string Str
);
52 // These all operate against the current section
53 virtual std::string
Package();
54 virtual std::string
Architecture();
55 virtual bool ArchitectureAll();
56 virtual std::string
Version();
57 virtual bool NewVersion(pkgCache::VerIterator
&Ver
);
58 virtual std::string
Description();
59 virtual std::string
DescriptionLanguage();
60 virtual MD5SumValue
Description_md5();
61 virtual unsigned short VersionHash();
62 virtual bool UsePackage(pkgCache::PkgIterator
&Pkg
,
63 pkgCache::VerIterator
&Ver
);
64 virtual unsigned long Offset() {return iOffset
;};
65 virtual unsigned long Size() {return Section
.size();};
69 bool LoadReleaseInfo(pkgCache::PkgFileIterator
&FileI
,FileFd
&File
,
72 static const char *ParseDepends(const char *Start
,const char *Stop
,
73 std::string
&Package
,std::string
&Ver
,unsigned int &Op
,
74 bool const &ParseArchFlags
= false,
75 bool const &StripMultiArch
= true);
76 static const char *ConvertRelation(const char *I
,unsigned int &Op
);
78 debListParser(FileFd
*File
, std::string
const &Arch
= "");
79 virtual ~debListParser() {};