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