apt @VERSION@
debmetaindex.h
00001 // ijones, walters
00002 #ifndef PKGLIB_DEBMETAINDEX_H
00003 #define PKGLIB_DEBMETAINDEX_H
00004 
00005 #include <apt-pkg/metaindex.h>
00006 
00007 #include <map>
00008 #include <string>
00009 #include <vector>
00010 
00011 class debReleaseIndex : public metaIndex {
00012    public:
00013 
00014    class debSectionEntry
00015    {
00016       public:
00017       debSectionEntry (std::string const &Section, bool const &IsSrc);
00018       std::string const Section;
00019       bool const IsSrc;
00020    };
00021 
00022    private:
00024    void *d;
00025    std::map<std::string, std::vector<debSectionEntry const*> > ArchEntries;
00026    enum { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted;
00027 
00028    public:
00029 
00030    debReleaseIndex(std::string const &URI, std::string const &Dist);
00031    debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted);
00032    virtual ~debReleaseIndex();
00033 
00034    virtual std::string ArchiveURI(std::string const &File) const {return URI + File;};
00035    virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const;
00036    std::vector <struct IndexTarget *>* ComputeIndexTargets() const;
00037    std::string Info(const char *Type, std::string const &Section, std::string const &Arch="") const;
00038    std::string MetaIndexInfo(const char *Type) const;
00039    std::string MetaIndexFile(const char *Types) const;
00040    std::string MetaIndexURI(const char *Type) const;
00041    std::string IndexURI(const char *Type, std::string const &Section, std::string const &Arch="native") const;
00042    std::string IndexURISuffix(const char *Type, std::string const &Section, std::string const &Arch="native") const;
00043    std::string SourceIndexURI(const char *Type, const std::string &Section) const;
00044    std::string SourceIndexURISuffix(const char *Type, const std::string &Section) const;
00045    std::string TranslationIndexURI(const char *Type, const std::string &Section) const;
00046    std::string TranslationIndexURISuffix(const char *Type, const std::string &Section) const;
00047    virtual std::vector <pkgIndexFile *> *GetIndexFiles();
00048 
00049    void SetTrusted(bool const Trusted);
00050    virtual bool IsTrusted() const;
00051 
00052    void PushSectionEntry(std::vector<std::string> const &Archs, const debSectionEntry *Entry);
00053    void PushSectionEntry(std::string const &Arch, const debSectionEntry *Entry);
00054    void PushSectionEntry(const debSectionEntry *Entry);
00055 };
00056 
00057 #endif