debrecords.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: debrecords.h,v 1.8 2001/03/13 06:51:46 jgg Exp $
  4. /* ######################################################################
  5. Debian Package Records - Parser for debian package records
  6. This provides display-type parsing for the Packages file. This is
  7. different than the the list parser which provides cache generation
  8. services. There should be no overlap between these two.
  9. ##################################################################### */
  10. /*}}}*/
  11. #ifndef PKGLIB_DEBRECORDS_H
  12. #define PKGLIB_DEBRECORDS_H
  13. #include <apt-pkg/pkgrecords.h>
  14. #include <apt-pkg/tagfile.h>
  15. #include <apt-pkg/fileutl.h>
  16. #ifndef APT_8_CLEANER_HEADERS
  17. #include <apt-pkg/indexfile.h>
  18. #endif
  19. class debRecordParser : public pkgRecords::Parser
  20. {
  21. /** \brief dpointer placeholder (for later in case we need it) */
  22. void *d;
  23. FileFd File;
  24. pkgTagFile Tags;
  25. pkgTagSection Section;
  26. protected:
  27. virtual bool Jump(pkgCache::VerFileIterator const &Ver);
  28. virtual bool Jump(pkgCache::DescFileIterator const &Desc);
  29. public:
  30. // These refer to the archive file for the Version
  31. virtual std::string FileName();
  32. virtual std::string MD5Hash();
  33. virtual std::string SHA1Hash();
  34. virtual std::string SHA256Hash();
  35. virtual std::string SHA512Hash();
  36. virtual std::string SourcePkg();
  37. virtual std::string SourceVer();
  38. // These are some general stats about the package
  39. virtual std::string Maintainer();
  40. virtual std::string ShortDesc();
  41. virtual std::string LongDesc();
  42. virtual std::string Name();
  43. virtual std::string Homepage();
  44. // An arbitrary custom field
  45. virtual std::string RecordField(const char *fieldName);
  46. virtual void GetRec(const char *&Start,const char *&Stop);
  47. debRecordParser(std::string FileName,pkgCache &Cache);
  48. virtual ~debRecordParser() {};
  49. };
  50. #endif