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.
 
 
 
 
 
 

58 lines
1.8 KiB

  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. /* ######################################################################
  4. Directory Stream
  5. When unpacking the contents of the archive are passed into a directory
  6. stream class for analysis and processing. The class controls all aspects
  7. of actually writing the directory stream from disk. The low level
  8. archive handlers are only responsible for decoding the archive format
  9. and sending events (via method calls) to the specified directory
  10. stream.
  11. When unpacking a real file the archive handler is passed back a file
  12. handle to write the data to, this is to support strange
  13. archives+unpacking methods. If that fd is -1 then the file data is
  14. simply ignored.
  15. The provided defaults do the 'Right Thing' for a normal unpacking
  16. process (ie 'tar')
  17. ##################################################################### */
  18. /*}}}*/
  19. #ifndef PKGLIB_DIRSTREAM_H
  20. #define PKGLIB_DIRSTREAM_H
  21. #include <apt-pkg/macros.h>
  22. class pkgDirStream
  23. {
  24. public:
  25. // All possible information about a component
  26. struct Item
  27. {
  28. enum Type_t {File, HardLink, SymbolicLink, CharDevice, BlockDevice,
  29. Directory, FIFO} Type;
  30. char *Name;
  31. char *LinkTarget;
  32. unsigned long Mode;
  33. unsigned long UID;
  34. unsigned long GID;
  35. unsigned long long Size;
  36. unsigned long MTime;
  37. unsigned long Major;
  38. unsigned long Minor;
  39. };
  40. virtual bool DoItem(Item &Itm,int &Fd);
  41. virtual bool Fail(Item &Itm,int Fd);
  42. virtual bool FinishedFile(Item &Itm,int Fd);
  43. virtual bool Process(Item &/*Itm*/,const unsigned char * /*Data*/,
  44. unsigned long long /*Size*/,unsigned long long /*Pos*/) {return true;};
  45. virtual ~pkgDirStream() {};
  46. };
  47. #endif