aboutsummaryrefslogtreecommitdiff
path: root/CPP/7zip/Archive/Tar/TarUpdate.h
blob: f6c2e779f0c4c2e6efb36d7da6d94ff983ff2a51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// TarUpdate.h

#ifndef ZIP7_INC_TAR_UPDATE_H
#define ZIP7_INC_TAR_UPDATE_H

#include "../IArchive.h"

#include "TarItem.h"

namespace NArchive {
namespace NTar {

struct CUpdateItem
{
  int IndexInArc;
  unsigned IndexInClient;
  UInt64 Size;
  // Int64 MTime;
  UInt32 Mode;
  bool NewData;
  bool NewProps;
  bool IsDir;
  bool DeviceMajor_Defined;
  bool DeviceMinor_Defined;
  UInt32 UID;
  UInt32 GID;
  UInt32 DeviceMajor;
  UInt32 DeviceMinor;
  AString Name;
  AString User;
  AString Group;

  CPaxTimes PaxTimes;

  CUpdateItem():
      Size(0),
      IsDir(false),
      DeviceMajor_Defined(false),
      DeviceMinor_Defined(false),
      UID(0),
      GID(0)
      {}
};


struct CUpdateOptions
{
  UINT CodePage;
  unsigned UtfFlags;
  bool PosixMode;
  CBoolPair Write_MTime;
  CBoolPair Write_ATime;
  CBoolPair Write_CTime;
  CTimeOptions TimeOptions;
};


HRESULT UpdateArchive(IInStream *inStream, ISequentialOutStream *outStream,
    const CObjectVector<CItemEx> &inputItems,
    const CObjectVector<CUpdateItem> &updateItems,
    const CUpdateOptions &options,
    IArchiveUpdateCallback *updateCallback);

HRESULT GetPropString(IArchiveUpdateCallback *callback, UInt32 index, PROPID propId, AString &res,
    UINT codePage, unsigned utfFlags, bool convertSlash);

HRESULT Prop_To_PaxTime(const NWindows::NCOM::CPropVariant &prop, CPaxTime &pt);

void Get_AString_From_UString(const UString &s, AString &res,
    UINT codePage, unsigned utfFlags);

}}

#endif