debmetaindex.h 2.3 KB

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