You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

59 lines
1.9 KiB

  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: debsrcrecords.h,v 1.8 2004/03/17 05:58:54 mdz 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. #include <apt-pkg/fileutl.h>
  17. class debSrcRecordParser : public pkgSrcRecords::Parser
  18. {
  19. FileFd Fd;
  20. pkgTagFile Tags;
  21. pkgTagSection Sect;
  22. char *StaticBinList[400];
  23. unsigned long iOffset;
  24. char *Buffer;
  25. unsigned int BufSize;
  26. public:
  27. virtual bool Restart() {return Tags.Jump(Sect,0);};
  28. virtual bool Step() {iOffset = Tags.Offset(); return Tags.Step(Sect);};
  29. virtual bool Jump(unsigned long Off) {iOffset = Off; return Tags.Jump(Sect,Off);};
  30. virtual string Package() const {return Sect.FindS("Package");};
  31. virtual string Version() const {return Sect.FindS("Version");};
  32. virtual string Maintainer() const {return Sect.FindS("Maintainer");};
  33. virtual string Section() const {return Sect.FindS("Section");};
  34. virtual const char **Binaries();
  35. virtual bool BuildDepends(vector<BuildDepRec> &BuildDeps, bool ArchOnly);
  36. virtual unsigned long Offset() {return iOffset;};
  37. virtual string AsStr()
  38. {
  39. const char *Start=0,*Stop=0;
  40. Sect.GetSection(Start,Stop);
  41. return string(Start,Stop);
  42. };
  43. virtual bool Files(vector<pkgSrcRecords::File> &F);
  44. debSrcRecordParser(string File,pkgIndexFile const *Index)
  45. : Parser(Index), Fd(File,FileFd::ReadOnly), Tags(&Fd,102400),
  46. Buffer(0), BufSize(0) {}
  47. };
  48. #endif