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/pkgcache.h>
  12. #include <apt-pkg/dirstream.h>
  13. #include <string>
  14. class DebFile : public pkgDirStream
  15. {
  16. FileFd File;
  17. unsigned long Size;
  18. char *Control;
  19. unsigned long ControlLen;
  20. public:
  21. DebFile(const char *FileName);
  22. ~DebFile();
  23. bool DoItem(Item &I, int &fd);
  24. bool Process(pkgDirStream::Item &I, const unsigned char *data,
  25. unsigned long size, unsigned long pos);
  26. bool Go();
  27. bool ParseInfo();
  28. static std::string GetInstalledVer(const std::string &package);
  29. std::string Package;
  30. std::string Version;
  31. std::string DepVer, PreDepVer;
  32. unsigned int DepOp, PreDepOp;
  33. char *Config;
  34. char *Template;
  35. static pkgCache *Cache;
  36. enum { None, IsControl, IsConfig, IsTemplate } Which;
  37. };
  38. #endif