deblistparser.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: deblistparser.h,v 1.6 1998/12/14 02:23:47 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. // Parser Helper
  20. struct WordList
  21. {
  22. char *Str;
  23. unsigned char Val;
  24. };
  25. unsigned long UniqFindTagWrite(const char *Tag);
  26. bool ParseStatus(pkgCache::PkgIterator Pkg,pkgCache::VerIterator Ver);
  27. const char *ParseDepends(const char *Start,const char *Stop,
  28. string &Package,string &Ver,unsigned int &Op);
  29. bool ParseDepends(pkgCache::VerIterator Ver,const char *Tag,
  30. unsigned int Type);
  31. bool ParseProvides(pkgCache::VerIterator Ver);
  32. bool GrabWord(string Word,WordList *List,int Count,unsigned char &Out);
  33. public:
  34. // These all operate against the current section
  35. virtual string Package();
  36. virtual string Version();
  37. virtual bool NewVersion(pkgCache::VerIterator Ver);
  38. virtual bool UsePackage(pkgCache::PkgIterator Pkg,
  39. pkgCache::VerIterator Ver);
  40. virtual unsigned long Offset() {return iOffset;};
  41. virtual unsigned long Size() {return Section.size();};
  42. virtual bool Step();
  43. bool LoadReleaseInfo(pkgCache::PkgFileIterator FileI,FileFd &File);
  44. debListParser(FileFd &File);
  45. };
  46. #endif