indexrecords.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. class indexRecords
  14. {
  15. bool parseSumData(const char *&Start, const char *End, string &Name,
  16. string &Hash, size_t &Size);
  17. public:
  18. struct checkSum;
  19. string ErrorText;
  20. protected:
  21. string Dist;
  22. string Suite;
  23. string ExpectedDist;
  24. std::map<string,checkSum *> Entries;
  25. public:
  26. indexRecords();
  27. indexRecords(const string ExpectedDist);
  28. // Lookup function
  29. virtual const checkSum *Lookup(const string MetaKey);
  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. string MD5Hash;
  40. size_t Size;
  41. };
  42. #endif