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