deblistparser.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: deblistparser.h,v 1.1 1998/07/04 05:58: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 <pkglib/pkgcachegen.h>
  13. #include <pkglib/tagfile.h>
  14. class debListParser : public pkgCacheGenerator::ListParser
  15. {
  16. pkgTagFile Tags;
  17. pkgTagSection Section;
  18. // Parser Helper
  19. struct WordList
  20. {
  21. char *Str;
  22. unsigned char Val;
  23. };
  24. string FindTag(const char *Tag);
  25. unsigned long UniqFindTagWrite(const char *Tag);
  26. bool HandleFlag(const char *Tag,unsigned long &Flags,unsigned long Flag);
  27. bool ParseStatus(pkgCache::PkgIterator Pkg,pkgCache::VerIterator Ver);
  28. bool GrabWord(string Word,WordList *List,int Count,unsigned char &Out);
  29. public:
  30. // These all operate against the current section
  31. virtual string Package();
  32. virtual string Version();
  33. virtual bool NewVersion(pkgCache::VerIterator Ver);
  34. virtual bool NewPackage(pkgCache::PkgIterator Pkg);
  35. virtual bool UsePackage(pkgCache::PkgIterator Pkg,
  36. pkgCache::VerIterator Ver);
  37. virtual bool Step();
  38. debListParser(File &File);
  39. };
  40. #endif