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.
 
 
 
 
 
 

57 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. #include <apt-pkg/srcrecords.h>
  12. #include <apt-pkg/tagfile.h>
  13. #include <apt-pkg/fileutl.h>
  14. class debSrcRecordParser : public pkgSrcRecords::Parser
  15. {
  16. FileFd Fd;
  17. pkgTagFile Tags;
  18. pkgTagSection Sect;
  19. char *StaticBinList[400];
  20. unsigned long iOffset;
  21. char *Buffer;
  22. unsigned int BufSize;
  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 const &Off) {iOffset = Off; return Tags.Jump(Sect,Off);};
  27. virtual string Package() const {return Sect.FindS("Package");};
  28. virtual string Version() const {return Sect.FindS("Version");};
  29. virtual string Maintainer() const {return Sect.FindS("Maintainer");};
  30. virtual string Section() const {return Sect.FindS("Section");};
  31. virtual const char **Binaries();
  32. virtual bool BuildDepends(vector<BuildDepRec> &BuildDeps, bool const &ArchOnly, bool const &StripMultiArch = true);
  33. virtual unsigned long Offset() {return iOffset;};
  34. virtual string AsStr()
  35. {
  36. const char *Start=0,*Stop=0;
  37. Sect.GetSection(Start,Stop);
  38. return string(Start,Stop);
  39. };
  40. virtual bool Files(vector<pkgSrcRecords::File> &F);
  41. debSrcRecordParser(string const &File,pkgIndexFile const *Index)
  42. : Parser(Index), Fd(File,FileFd::ReadOnlyGzip), Tags(&Fd,102400),
  43. Buffer(0), BufSize(0) {}
  44. ~debSrcRecordParser();
  45. };
  46. #endif