debsrcrecords.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: debsrcrecords.h,v 1.3 1999/04/07 05:51:01 jgg Exp $
  4. /* ######################################################################
  5. Debian Source Package Records - Parser implementation for Debian style
  6. source indexes
  7. ##################################################################### */
  8. /*}}}*/
  9. #ifndef PKGLIB_DEBSRCRECORDS_H
  10. #define PKGLIB_DEBSRCRECORDS_H
  11. #ifdef __GNUG__
  12. #pragma interface "apt-pkg/debsrcrecords.h"
  13. #endif
  14. #include <apt-pkg/srcrecords.h>
  15. #include <apt-pkg/tagfile.h>
  16. class debSrcRecordParser : public pkgSrcRecords::Parser
  17. {
  18. pkgTagFile Tags;
  19. pkgTagSection Sect;
  20. char Buffer[10000];
  21. const char *StaticBinList[400];
  22. unsigned long iOffset;
  23. public:
  24. virtual bool Restart() {return Tags.Jump(Sect,0);};
  25. virtual bool Step() {iOffset = Tags.Offset(); return Tags.Step(Sect);};
  26. virtual bool Jump(unsigned long Off) {iOffset = Off; return Tags.Jump(Sect,Off);};
  27. virtual string Package() {return Sect.FindS("Package");};
  28. virtual string Version() {return Sect.FindS("Version");};
  29. virtual string Maintainer() {return Sect.FindS("Maintainer");};
  30. virtual string Section() {return Sect.FindS("Section");};
  31. virtual const char **Binaries();
  32. virtual unsigned long Offset() {return iOffset;};
  33. virtual bool Files(vector<pkgSrcRecords::File> &F);
  34. debSrcRecordParser(FileFd *File,pkgSourceList::const_iterator SrcItem) :
  35. Parser(File,SrcItem),
  36. Tags(*File,sizeof(Buffer)) {};
  37. };
  38. #endif