metaindex.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef PKGLIB_METAINDEX_H
  2. #define PKGLIB_METAINDEX_H
  3. #include <string>
  4. #include <apt-pkg/pkgcache.h>
  5. #include <apt-pkg/srcrecords.h>
  6. #include <apt-pkg/pkgrecords.h>
  7. #include <apt-pkg/indexfile.h>
  8. #include <apt-pkg/vendor.h>
  9. using std::string;
  10. class pkgAcquire;
  11. class pkgCacheGenerator;
  12. class OpProgress;
  13. class metaIndex
  14. {
  15. protected:
  16. vector <pkgIndexFile *> *Indexes;
  17. const char *Type;
  18. string URI;
  19. string Dist;
  20. bool Trusted;
  21. public:
  22. // Various accessors
  23. virtual string GetURI() const {return URI;}
  24. virtual string GetDist() const {return Dist;}
  25. virtual const char* GetType() const {return Type;}
  26. // Interface for acquire
  27. virtual string ArchiveURI(string const& /*File*/) const = 0;
  28. virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const = 0;
  29. virtual vector<pkgIndexFile *> *GetIndexFiles() = 0;
  30. virtual bool IsTrusted() const = 0;
  31. virtual ~metaIndex() {
  32. if (Indexes == 0)
  33. return;
  34. for (vector<pkgIndexFile *>::iterator I = (*Indexes).begin(); I != (*Indexes).end(); ++I)
  35. delete *I;
  36. delete Indexes;
  37. }
  38. };
  39. #endif