debmetaindex.h 2.4 KB

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