]>
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>
16 #include <apt-pkg/md5.h>
17 #include <apt-pkg/pkgcache.h>
22 #ifndef APT_8_CLEANER_HEADERS
23 #include <apt-pkg/indexfile.h>
28 class debListParser
: public pkgCacheGenerator::ListParser
40 /** \brief dpointer placeholder (for later in case we need it) */
45 pkgTagSection Section
;
46 unsigned long iOffset
;
48 std::vector
<std::string
> Architectures
;
49 bool MultiArchEnabled
;
51 unsigned long UniqFindTagWrite(const char *Tag
);
52 virtual bool ParseStatus(pkgCache::PkgIterator
&Pkg
,pkgCache::VerIterator
&Ver
);
53 bool ParseDepends(pkgCache::VerIterator
&Ver
,const char *Tag
,
55 bool ParseProvides(pkgCache::VerIterator
&Ver
);
56 bool NewProvidesAllArch(pkgCache::VerIterator
&Ver
, std::string
const &Package
, std::string
const &Version
);
57 static bool GrabWord(std::string Word
,WordList
*List
,unsigned char &Out
);
61 static unsigned char GetPrio(std::string Str
);
63 // These all operate against the current section
64 virtual std::string
Package();
65 virtual std::string
Architecture();
66 virtual bool ArchitectureAll();
67 virtual std::string
Version();
68 virtual bool NewVersion(pkgCache::VerIterator
&Ver
);
69 virtual std::string
Description();
70 virtual std::string
DescriptionLanguage();
71 virtual MD5SumValue
Description_md5();
72 virtual unsigned short VersionHash();
73 #if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
74 virtual bool SameVersion(unsigned short const Hash
, pkgCache::VerIterator
const &Ver
);
76 virtual bool UsePackage(pkgCache::PkgIterator
&Pkg
,
77 pkgCache::VerIterator
&Ver
);
78 virtual unsigned long Offset() {return iOffset
;};
79 virtual unsigned long Size() {return Section
.size();};
83 bool LoadReleaseInfo(pkgCache::PkgFileIterator
&FileI
,FileFd
&File
,
86 static const char *ParseDepends(const char *Start
,const char *Stop
,
87 std::string
&Package
,std::string
&Ver
,unsigned int &Op
);
88 static const char *ParseDepends(const char *Start
,const char *Stop
,
89 std::string
&Package
,std::string
&Ver
,unsigned int &Op
,
90 bool const &ParseArchFlags
);
91 static const char *ParseDepends(const char *Start
,const char *Stop
,
92 std::string
&Package
,std::string
&Ver
,unsigned int &Op
,
93 bool const &ParseArchFlags
, bool const &StripMultiArch
);
94 static const char *ParseDepends(const char *Start
,const char *Stop
,
95 std::string
&Package
,std::string
&Ver
,unsigned int &Op
,
96 bool const &ParseArchFlags
, bool const &StripMultiArch
,
97 bool const &ParseRestrictionsList
);
99 static const char *ConvertRelation(const char *I
,unsigned int &Op
);
101 debListParser(FileFd
*File
, std::string
const &Arch
= "");
102 virtual ~debListParser() {};
105 unsigned char ParseMultiArch(bool const showErrors
);