deblistparser.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: deblistparser.h,v 1.2 1998/07/04 22:32:18 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. signed long FindTagI(const char *Tag,signed long Default = 0);
  26. unsigned long UniqFindTagWrite(const char *Tag);
  27. bool HandleFlag(const char *Tag,unsigned long &Flags,unsigned long Flag);
  28. bool ParseStatus(pkgCache::PkgIterator Pkg,pkgCache::VerIterator Ver);
  29. bool GrabWord(string Word,WordList *List,int Count,unsigned char &Out);
  30. public:
  31. // These all operate against the current section
  32. virtual string Package();
  33. virtual string Version();
  34. virtual bool NewVersion(pkgCache::VerIterator Ver);
  35. virtual bool NewPackage(pkgCache::PkgIterator Pkg);
  36. virtual bool UsePackage(pkgCache::PkgIterator Pkg,
  37. pkgCache::VerIterator Ver);
  38. virtual bool Step();
  39. debListParser(File &File);
  40. };
  41. #endif