debmetaindex.h 2.2 KB

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