deblistparser.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: deblistparser.h,v 1.8 1999/07/26 17:46:08 jgg Exp $
  4. /* ######################################################################
  5. Debian Package List Parser - This implements the abstract parser
  6. interface for Debian package files
  7. ##################################################################### */
  8. /*}}}*/
  9. // Header section: pkglib
  10. #ifndef PKGLIB_DEBLISTPARSER_H
  11. #define PKGLIB_DEBLISTPARSER_H
  12. #include <apt-pkg/pkgcachegen.h>
  13. #include <apt-pkg/tagfile.h>
  14. class debListParser : public pkgCacheGenerator::ListParser
  15. {
  16. pkgTagFile Tags;
  17. pkgTagSection Section;
  18. unsigned long iOffset;
  19. string Arch;
  20. // Parser Helper
  21. struct WordList
  22. {
  23. char *Str;
  24. unsigned char Val;
  25. };
  26. unsigned long UniqFindTagWrite(const char *Tag);
  27. bool ParseStatus(pkgCache::PkgIterator Pkg,pkgCache::VerIterator Ver);
  28. const char *ParseDepends(const char *Start,const char *Stop,
  29. string &Package,string &Ver,unsigned int &Op);
  30. bool ParseDepends(pkgCache::VerIterator Ver,const char *Tag,
  31. unsigned int Type);
  32. bool ParseProvides(pkgCache::VerIterator Ver);
  33. bool GrabWord(string Word,WordList *List,int Count,unsigned char &Out);
  34. public:
  35. // These all operate against the current section
  36. virtual string Package();
  37. virtual string Version();
  38. virtual bool NewVersion(pkgCache::VerIterator Ver);
  39. virtual unsigned short VersionHash();
  40. virtual bool UsePackage(pkgCache::PkgIterator Pkg,
  41. pkgCache::VerIterator Ver);
  42. virtual unsigned long Offset() {return iOffset;};
  43. virtual unsigned long Size() {return Section.size();};
  44. virtual bool Step();
  45. bool LoadReleaseInfo(pkgCache::PkgFileIterator FileI,FileFd &File);
  46. debListParser(FileFd &File);
  47. };
  48. #endif