apt  1.5
debrecords.h
00001 // -*- mode: cpp; mode: fold -*-
00002 // Description                                                          /*{{{*/
00003 // $Id: debrecords.h,v 1.8 2001/03/13 06:51:46 jgg Exp $
00004 /* ######################################################################
00005    
00006    Debian Package Records - Parser for debian package records
00007    
00008    This provides display-type parsing for the Packages file. This is 
00009    different than the the list parser which provides cache generation
00010    services. There should be no overlap between these two.
00011    
00012    ##################################################################### */
00013                                                                         /*}}}*/
00014 #ifndef PKGLIB_DEBRECORDS_H
00015 #define PKGLIB_DEBRECORDS_H
00016 
00017 #include <apt-pkg/pkgrecords.h>
00018 #include <apt-pkg/tagfile.h>
00019 #include <apt-pkg/fileutl.h>
00020 
00021 #ifndef APT_8_CLEANER_HEADERS
00022 #include <apt-pkg/indexfile.h>
00023 #endif
00024 
00025 class debRecordParser : public pkgRecords::Parser
00026 {
00028    void *d;
00029 
00030    FileFd File;
00031    pkgTagFile Tags;
00032    pkgTagSection Section;
00033    
00034    protected:
00035    
00036    virtual bool Jump(pkgCache::VerFileIterator const &Ver);
00037    virtual bool Jump(pkgCache::DescFileIterator const &Desc);
00038    
00039    public:
00040 
00041    // These refer to the archive file for the Version
00042    virtual std::string FileName();
00043    virtual std::string MD5Hash();
00044    virtual std::string SHA1Hash();
00045    virtual std::string SHA256Hash();
00046    virtual std::string SHA512Hash();
00047    virtual std::string SourcePkg();
00048    virtual std::string SourceVer();
00049    
00050    // These are some general stats about the package
00051    virtual std::string Maintainer();
00052    virtual std::string ShortDesc();
00053    virtual std::string LongDesc();
00054    virtual std::string Name();
00055    virtual std::string Homepage();
00056 
00057    // An arbitrary custom field
00058    virtual std::string RecordField(const char *fieldName);
00059 
00060    virtual void GetRec(const char *&Start,const char *&Stop);
00061    
00062    debRecordParser(std::string FileName,pkgCache &Cache);
00063    virtual ~debRecordParser() {};
00064 };
00065 
00066 #endif