indexrecords.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: indexrecords.h,v 1.1.2.1 2003/12/24 23:09:17 mdz Exp $
  4. /*}}}*/
  5. #ifndef PKGLIB_INDEXRECORDS_H
  6. #define PKGLIB_INDEXRECORDS_H
  7. #include <apt-pkg/pkgcache.h>
  8. #include <apt-pkg/fileutl.h>
  9. #include <apt-pkg/hashes.h>
  10. #include <map>
  11. #include <vector>
  12. class indexRecords
  13. {
  14. bool parseSumData(const char *&Start, const char *End, string &Name,
  15. string &Hash, size_t &Size);
  16. public:
  17. struct checkSum;
  18. string ErrorText;
  19. protected:
  20. string Dist;
  21. string Suite;
  22. string ExpectedDist;
  23. std::map<string,checkSum *> Entries;
  24. public:
  25. indexRecords();
  26. indexRecords(const string ExpectedDist);
  27. // Lookup function
  28. virtual const checkSum *Lookup(const string MetaKey);
  29. std::vector<std::string> MetaKeys();
  30. virtual bool Load(string Filename);
  31. string GetDist() const;
  32. virtual bool CheckDist(const string MaybeDist) const;
  33. string GetExpectedDist() const;
  34. virtual ~indexRecords(){};
  35. };
  36. struct indexRecords::checkSum
  37. {
  38. string MetaKeyFilename;
  39. HashString Hash;
  40. size_t Size;
  41. };
  42. #endif