2
0

7zUpdate.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // 7zUpdate.h
  2. #ifndef __7Z_UPDATE_H
  3. #define __7Z_UPDATE_H
  4. #include "7zIn.h"
  5. #include "7zOut.h"
  6. #include "7zCompressionMode.h"
  7. #include "../IArchive.h"
  8. namespace NArchive {
  9. namespace N7z {
  10. struct CUpdateItem
  11. {
  12. bool NewData;
  13. bool NewProperties;
  14. int IndexInArchive;
  15. int IndexInClient;
  16. UInt32 Attributes;
  17. FILETIME CreationTime;
  18. FILETIME LastWriteTime;
  19. FILETIME LastAccessTime;
  20. UInt64 Size;
  21. UString Name;
  22. bool IsAnti;
  23. bool IsDirectory;
  24. bool IsCreationTimeDefined;
  25. bool IsLastWriteTimeDefined;
  26. bool IsLastAccessTimeDefined;
  27. bool AttributesAreDefined;
  28. bool HasStream() const
  29. { return !IsDirectory && !IsAnti && Size != 0; }
  30. CUpdateItem():
  31. IsAnti(false),
  32. AttributesAreDefined(false),
  33. IsCreationTimeDefined(false),
  34. IsLastWriteTimeDefined(false),
  35. IsLastAccessTimeDefined(false)
  36. {}
  37. void SetDirectoryStatusFromAttributes()
  38. { IsDirectory = ((Attributes & FILE_ATTRIBUTE_DIRECTORY) != 0); };
  39. int GetExtensionPos() const;
  40. UString GetExtension() const;
  41. };
  42. struct CUpdateOptions
  43. {
  44. const CCompressionMethodMode *Method;
  45. const CCompressionMethodMode *HeaderMethod;
  46. bool UseFilters;
  47. bool MaxFilter;
  48. CHeaderOptions HeaderOptions;
  49. UInt64 NumSolidFiles;
  50. UInt64 NumSolidBytes;
  51. bool SolidExtension;
  52. bool RemoveSfxBlock;
  53. bool VolumeMode;
  54. };
  55. HRESULT Update(
  56. DECL_EXTERNAL_CODECS_LOC_VARS
  57. IInStream *inStream,
  58. const CArchiveDatabaseEx *database,
  59. const CObjectVector<CUpdateItem> &updateItems,
  60. ISequentialOutStream *seqOutStream,
  61. IArchiveUpdateCallback *updateCallback,
  62. const CUpdateOptions &options);
  63. }}
  64. #endif