metaindex.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef PKGLIB_METAINDEX_H
  2. #define PKGLIB_METAINDEX_H
  3. #include <apt-pkg/indexfile.h>
  4. #include <apt-pkg/init.h>
  5. #include <stddef.h>
  6. #include <string>
  7. #include <vector>
  8. #ifndef APT_10_CLEANER_HEADERS
  9. #include <apt-pkg/pkgcache.h>
  10. class pkgCacheGenerator;
  11. class OpProgress;
  12. #endif
  13. #ifndef APT_8_CLEANER_HEADERS
  14. #include <apt-pkg/srcrecords.h>
  15. #include <apt-pkg/pkgrecords.h>
  16. #include <apt-pkg/vendor.h>
  17. using std::string;
  18. #endif
  19. class pkgAcquire;
  20. class IndexTarget;
  21. class pkgCacheGenerator;
  22. class OpProgress;
  23. class metaIndex
  24. {
  25. void *d;
  26. protected:
  27. std::vector <pkgIndexFile *> *Indexes;
  28. const char *Type;
  29. std::string URI;
  30. std::string Dist;
  31. bool Trusted;
  32. public:
  33. // Various accessors
  34. virtual std::string GetURI() const {return URI;}
  35. virtual std::string GetDist() const {return Dist;}
  36. virtual const char* GetType() const {return Type;}
  37. // interface to to query it
  38. /** \return the path of the local file (or "" if its not available) */
  39. virtual std::string LocalFileName() const;
  40. // Interface for acquire
  41. virtual std::string ArchiveURI(std::string const& File) const = 0;
  42. virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const = 0;
  43. virtual std::vector<IndexTarget> GetIndexTargets() const = 0;
  44. virtual std::vector<pkgIndexFile *> *GetIndexFiles() = 0;
  45. virtual bool IsTrusted() const = 0;
  46. virtual std::string Describe() const;
  47. virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool const ModifyCheck) const;
  48. virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const;
  49. metaIndex(std::string const &URI, std::string const &Dist,
  50. char const * const Type);
  51. virtual ~metaIndex();
  52. };
  53. #endif