You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

76 lines
2.5 KiB

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