]>
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> 
  17 #ifndef APT_8_CLEANER_HEADERS 
  18 #include <apt-pkg/indexfile.h> 
  21 class debListParser 
: public pkgCacheGenerator::ListParser
 
  33    /** \brief dpointer placeholder (for later in case we need it) */ 
  38    pkgTagSection Section
; 
  39    unsigned long iOffset
; 
  41    std::vector
<std::string
> Architectures
; 
  42    bool MultiArchEnabled
; 
  44    unsigned long UniqFindTagWrite(const char *Tag
); 
  45    virtual bool ParseStatus(pkgCache::PkgIterator 
&Pkg
,pkgCache::VerIterator 
&Ver
); 
  46    bool ParseDepends(pkgCache::VerIterator 
&Ver
,const char *Tag
, 
  48    bool ParseProvides(pkgCache::VerIterator 
&Ver
); 
  49    bool NewProvidesAllArch(pkgCache::VerIterator 
&Ver
, std::string 
const &Package
, std::string 
const &Version
); 
  50    static bool GrabWord(std::string Word
,WordList 
*List
,unsigned char &Out
); 
  54    static unsigned char GetPrio(std::string Str
); 
  56    // These all operate against the current section 
  57    virtual std::string 
Package(); 
  58    virtual std::string 
Architecture(); 
  59    virtual bool ArchitectureAll(); 
  60    virtual std::string 
Version(); 
  61    virtual bool NewVersion(pkgCache::VerIterator 
&Ver
); 
  62    virtual std::string 
Description(); 
  63    virtual std::string 
DescriptionLanguage(); 
  64    virtual MD5SumValue 
Description_md5(); 
  65    virtual unsigned short VersionHash(); 
  66    virtual bool UsePackage(pkgCache::PkgIterator 
&Pkg
, 
  67                            pkgCache::VerIterator 
&Ver
); 
  68    virtual unsigned long Offset() {return iOffset
;}; 
  69    virtual unsigned long Size() {return Section
.size();}; 
  73    bool LoadReleaseInfo(pkgCache::PkgFileIterator 
&FileI
,FileFd 
&File
, 
  76    static const char *ParseDepends(const char *Start
,const char *Stop
, 
  77                             std::string 
&Package
,std::string 
&Ver
,unsigned int &Op
, 
  78                             bool const &ParseArchFlags 
= false, 
  79                             bool const &StripMultiArch 
= true); 
  80    static const char *ConvertRelation(const char *I
,unsigned int &Op
); 
  82    debListParser(FileFd 
*File
, std::string 
const &Arch 
= ""); 
  83    virtual ~debListParser() {};