indexrecords.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #ifdef __GNUG__
  8. #pragma interface "apt-pkg/indexrecords.h"
  9. #endif
  10. #include <apt-pkg/pkgcache.h>
  11. #include <apt-pkg/fileutl.h>
  12. #include <map>
  13. #include <vector>
  14. class indexRecords
  15. {
  16. bool parseSumData(const char *&Start, const char *End, string &Name,
  17. string &Hash, size_t &Size);
  18. public:
  19. struct checkSum;
  20. string ErrorText;
  21. protected:
  22. string Dist;
  23. string Suite;
  24. string ExpectedDist;
  25. std::map<string,checkSum *> Entries;
  26. public:
  27. indexRecords();
  28. indexRecords(const string ExpectedDist);
  29. // Lookup function
  30. virtual const checkSum *Lookup(const string MetaKey);
  31. std::vector<std::string> MetaKeys();
  32. virtual bool Load(string Filename);
  33. string GetDist() const;
  34. virtual bool CheckDist(const string MaybeDist) const;
  35. string GetExpectedDist() const;
  36. virtual ~indexRecords(){};
  37. };
  38. struct indexRecords::checkSum
  39. {
  40. string MetaKeyFilename;
  41. string MD5Hash;
  42. size_t Size;
  43. };
  44. #endif