metaindex.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 metaIndex
  21. {
  22. protected:
  23. std::vector <pkgIndexFile *> *Indexes;
  24. const char *Type;
  25. std::string URI;
  26. std::string Dist;
  27. bool Trusted;
  28. public:
  29. // Various accessors
  30. virtual std::string GetURI() const {return URI;}
  31. virtual std::string GetDist() const {return Dist;}
  32. virtual const char* GetType() const {return Type;}
  33. // interface to to query it
  34. #if APT_PKG_ABI >= 413
  35. /** \return the path of the local file (or "" if its not available) */
  36. virtual std::string LocalFileName() const;
  37. #else
  38. std::string LocalFileName() const;
  39. #endif
  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<pkgIndexFile *> *GetIndexFiles() = 0;
  44. virtual bool IsTrusted() const = 0;
  45. metaIndex(std::string const &URI, std::string const &Dist,
  46. char const * const Type);
  47. virtual ~metaIndex();
  48. };
  49. #endif