apt-extracttemplates.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: apt-extracttemplates.h,v 1.2 2001/02/27 04:26:03 jgg Exp $
  4. /* ######################################################################
  5. apt-extracttemplate - tool to extract template and config data
  6. ##################################################################### */
  7. /*}}}*/
  8. #ifndef _APTEXTRACTTEMPLATE_H_
  9. #define _APTEXTRACTTEMPLATE_H_
  10. #include <apt-pkg/fileutl.h>
  11. #include <apt-pkg/dirstream.h>
  12. #include <string>
  13. class pkgCache;
  14. class DebFile : public pkgDirStream
  15. {
  16. FileFd File;
  17. char *Control;
  18. unsigned long ControlLen;
  19. public:
  20. explicit DebFile(const char *FileName);
  21. ~DebFile();
  22. bool DoItem(Item &I, int &fd) APT_OVERRIDE;
  23. bool Process(pkgDirStream::Item &I, const unsigned char *data,
  24. unsigned long long size, unsigned long long pos) APT_OVERRIDE;
  25. bool Go();
  26. bool ParseInfo();
  27. static std::string GetInstalledVer(const std::string &package);
  28. std::string Package;
  29. std::string Version;
  30. std::string DepVer, PreDepVer;
  31. unsigned int DepOp, PreDepOp;
  32. char *Config;
  33. char *Template;
  34. static pkgCache *Cache;
  35. enum { None, IsControl, IsConfig, IsTemplate } Which;
  36. };
  37. #endif