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.
 
 
 
 
 
 

66 lines
1.6 KiB

  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. protected:
  26. std::vector <pkgIndexFile *> *Indexes;
  27. const char *Type;
  28. std::string URI;
  29. std::string Dist;
  30. bool Trusted;
  31. public:
  32. // Various accessors
  33. virtual std::string GetURI() const {return URI;}
  34. virtual std::string GetDist() const {return Dist;}
  35. virtual const char* GetType() const {return Type;}
  36. // interface to to query it
  37. /** \return the path of the local file (or "" if its not available) */
  38. virtual std::string LocalFileName() const;
  39. // Interface for acquire
  40. virtual std::string ArchiveURI(std::string const& File) const = 0;
  41. virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const = 0;
  42. virtual std::vector<IndexTarget> GetIndexTargets() const = 0;
  43. virtual std::vector<pkgIndexFile *> *GetIndexFiles() = 0;
  44. virtual bool IsTrusted() const = 0;
  45. virtual std::string Describe() const;
  46. virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache) const;
  47. virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const;
  48. metaIndex(std::string const &URI, std::string const &Dist,
  49. char const * const Type);
  50. virtual ~metaIndex();
  51. };
  52. #endif