xref: /aosp_15_r20/external/lzma/CPP/7zip/Archive/Tar/TarOut.h (revision f6dc9357d832569d4d1f5d24eacdb3935a1ae8e6)
1 // Archive/TarOut.h
2 
3 #ifndef ZIP7_INC_ARCHIVE_TAR_OUT_H
4 #define ZIP7_INC_ARCHIVE_TAR_OUT_H
5 
6 #include "../../../Common/MyCom.h"
7 
8 #include "../../IStream.h"
9 
10 #include "TarItem.h"
11 
12 namespace NArchive {
13 namespace NTar {
14 
15 class COutArchive
16 {
17   CMyComPtr<ISequentialOutStream> Stream;
18 
19   AString Glob_Name;
20   AString Prefix;
21 
22   HRESULT WriteHeaderReal(const CItem &item, bool isPax = false
23       // , bool zero_PackSize = false
24       // , bool zero_MTime = false
25       );
26 
27   HRESULT Write_Data(const void *data, unsigned size);
28   HRESULT Write_Data_And_Residual(const void *data, unsigned size);
29 
30 public:
31   UInt64 Pos;
32   bool IsPosixMode;
33   // bool IsPrefixAllowed; // it's used only if (IsPosixMode == true)
34   CTimeOptions TimeOptions;
35 
Create(ISequentialOutStream * outStream)36   void Create(ISequentialOutStream *outStream)
37   {
38     Stream = outStream;
39   }
40   HRESULT WriteHeader(const CItem &item);
41   HRESULT Write_AfterDataResidual(UInt64 dataSize);
42   HRESULT WriteFinishHeader();
43 
COutArchive()44   COutArchive():
45       Pos(0),
46       IsPosixMode(false)
47       // , IsPrefixAllowed(true)
48       {}
49 };
50 
51 }}
52 
53 #endif
54