apt @VERSION@
|
00001 // ijones, walters 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: 00023 void *d; 00024 std::map<string, vector<debSectionEntry const*> > ArchEntries; 00025 enum { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted; 00026 00027 public: 00028 00029 debReleaseIndex(string const &URI, string const &Dist); 00030 debReleaseIndex(string const &URI, string const &Dist, bool const Trusted); 00031 virtual ~debReleaseIndex(); 00032 00033 virtual string ArchiveURI(string const &File) const {return URI + File;}; 00034 virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const; 00035 vector <struct IndexTarget *>* ComputeIndexTargets() const; 00036 string Info(const char *Type, string const &Section, string const &Arch="") const; 00037 string MetaIndexInfo(const char *Type) const; 00038 string MetaIndexFile(const char *Types) const; 00039 string MetaIndexURI(const char *Type) const; 00040 string IndexURI(const char *Type, string const &Section, string const &Arch="native") const; 00041 string IndexURISuffix(const char *Type, string const &Section, string const &Arch="native") const; 00042 string SourceIndexURI(const char *Type, const string &Section) const; 00043 string SourceIndexURISuffix(const char *Type, const string &Section) const; 00044 string TranslationIndexURI(const char *Type, const string &Section) const; 00045 string TranslationIndexURISuffix(const char *Type, const string &Section) const; 00046 virtual vector <pkgIndexFile *> *GetIndexFiles(); 00047 00048 void SetTrusted(bool const Trusted); 00049 virtual bool IsTrusted() const; 00050 00051 void PushSectionEntry(vector<string> const &Archs, const debSectionEntry *Entry); 00052 void PushSectionEntry(string const &Arch, const debSectionEntry *Entry); 00053 void PushSectionEntry(const debSectionEntry *Entry); 00054 }; 00055 00056 #endif