debrecords.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. class debRecordParser : public pkgRecords::Parser
  17. {
  18. /** \brief dpointer placeholder (for later in case we need it) */
  19. void *d;
  20. FileFd File;
  21. pkgTagFile Tags;
  22. pkgTagSection Section;
  23. protected:
  24. virtual bool Jump(pkgCache::VerFileIterator const &Ver);
  25. virtual bool Jump(pkgCache::DescFileIterator const &Desc);
  26. public:
  27. // These refer to the archive file for the Version
  28. virtual std::string FileName();
  29. virtual std::string MD5Hash();
  30. virtual std::string SHA1Hash();
  31. virtual std::string SHA256Hash();
  32. virtual std::string SHA512Hash();
  33. virtual std::string SourcePkg();
  34. virtual std::string SourceVer();
  35. // These are some general stats about the package
  36. virtual std::string Maintainer();
  37. virtual std::string ShortDesc();
  38. virtual std::string LongDesc();
  39. virtual std::string Name();
  40. virtual std::string Homepage();
  41. // An arbitrary custom field
  42. virtual std::string RecordField(const char *fieldName);
  43. virtual void GetRec(const char *&Start,const char *&Stop);
  44. debRecordParser(std::string FileName,pkgCache &Cache);
  45. virtual ~debRecordParser() {};
  46. };
  47. #endif