debmetaindex.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // ijones, walters
  2. #ifndef PKGLIB_DEBMETAINDEX_H
  3. #define PKGLIB_DEBMETAINDEX_H
  4. #include <apt-pkg/metaindex.h>
  5. #include <apt-pkg/sourcelist.h>
  6. #include <map>
  7. class debReleaseIndex : public metaIndex {
  8. public:
  9. class debSectionEntry
  10. {
  11. public:
  12. debSectionEntry (string const &Section, bool const &IsSrc);
  13. string const Section;
  14. bool const IsSrc;
  15. };
  16. private:
  17. /** \brief dpointer placeholder (for later in case we need it) */
  18. void *d;
  19. std::map<string, vector<debSectionEntry const*> > ArchEntries;
  20. enum { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted;
  21. public:
  22. debReleaseIndex(string const &URI, string const &Dist);
  23. debReleaseIndex(string const &URI, string const &Dist, bool const Trusted);
  24. virtual ~debReleaseIndex();
  25. virtual string ArchiveURI(string const &File) const {return URI + File;};
  26. virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const;
  27. vector <struct IndexTarget *>* ComputeIndexTargets() const;
  28. string Info(const char *Type, string const &Section, string const &Arch="") const;
  29. string MetaIndexInfo(const char *Type) const;
  30. string MetaIndexFile(const char *Types) const;
  31. string MetaIndexURI(const char *Type) const;
  32. string IndexURI(const char *Type, string const &Section, string const &Arch="native") const;
  33. string IndexURISuffix(const char *Type, string const &Section, string const &Arch="native") const;
  34. string SourceIndexURI(const char *Type, const string &Section) const;
  35. string SourceIndexURISuffix(const char *Type, const string &Section) const;
  36. string TranslationIndexURI(const char *Type, const string &Section) const;
  37. string TranslationIndexURISuffix(const char *Type, const string &Section) const;
  38. virtual vector <pkgIndexFile *> *GetIndexFiles();
  39. void SetTrusted(bool const Trusted);
  40. virtual bool IsTrusted() const;
  41. void PushSectionEntry(vector<string> const &Archs, const debSectionEntry *Entry);
  42. void PushSectionEntry(string const &Arch, const debSectionEntry *Entry);
  43. void PushSectionEntry(const debSectionEntry *Entry);
  44. };
  45. #endif