mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-06 21:14:58 -06:00
22.00
This commit is contained in:
42
CPP/7zip/Common/FileStreams.h
Normal file → Executable file
42
CPP/7zip/Common/FileStreams.h
Normal file → Executable file
@@ -14,10 +14,14 @@
|
||||
|
||||
#include "../IStream.h"
|
||||
|
||||
#include "UniqBlocks.h"
|
||||
|
||||
|
||||
class CInFileStream;
|
||||
struct IInFileStream_Callback
|
||||
{
|
||||
virtual HRESULT InFileStream_On_Error(UINT_PTR val, DWORD error) = 0;
|
||||
virtual void InFileStream_On_Destroy(UINT_PTR val) = 0;
|
||||
virtual void InFileStream_On_Destroy(CInFileStream *stream, UINT_PTR val) = 0;
|
||||
};
|
||||
|
||||
class CInFileStream:
|
||||
@@ -25,10 +29,11 @@ class CInFileStream:
|
||||
public IStreamGetSize,
|
||||
public IStreamGetProps,
|
||||
public IStreamGetProps2,
|
||||
public IStreamGetProp,
|
||||
public CMyUnknownImp
|
||||
{
|
||||
public:
|
||||
NWindows::NFile::NIO::CInFile File;
|
||||
public:
|
||||
|
||||
#ifdef USE_WIN_FILE
|
||||
|
||||
@@ -42,22 +47,46 @@ public:
|
||||
|
||||
#endif
|
||||
|
||||
bool SupportHardLinks;
|
||||
#ifdef _WIN32
|
||||
BY_HANDLE_FILE_INFORMATION _info;
|
||||
#else
|
||||
struct stat _info;
|
||||
UInt32 _uid;
|
||||
UInt32 _gid;
|
||||
UString OwnerName;
|
||||
UString OwnerGroup;
|
||||
bool StoreOwnerId;
|
||||
bool StoreOwnerName;
|
||||
#endif
|
||||
|
||||
bool _info_WasLoaded;
|
||||
bool SupportHardLinks;
|
||||
IInFileStream_Callback *Callback;
|
||||
UINT_PTR CallbackRef;
|
||||
|
||||
virtual ~CInFileStream();
|
||||
|
||||
CInFileStream();
|
||||
|
||||
void Set_PreserveATime(bool v)
|
||||
{
|
||||
File.PreserveATime = v;
|
||||
}
|
||||
|
||||
bool GetLength(UInt64 &length) const throw()
|
||||
{
|
||||
return File.GetLength(length);
|
||||
}
|
||||
|
||||
bool Open(CFSTR fileName)
|
||||
{
|
||||
_info_WasLoaded = false;
|
||||
return File.Open(fileName);
|
||||
}
|
||||
|
||||
bool OpenShared(CFSTR fileName, bool shareForWrite)
|
||||
{
|
||||
_info_WasLoaded = false;
|
||||
return File.OpenShared(fileName, shareForWrite);
|
||||
}
|
||||
|
||||
@@ -65,6 +94,7 @@ public:
|
||||
MY_QUERYINTERFACE_ENTRY(IStreamGetSize)
|
||||
MY_QUERYINTERFACE_ENTRY(IStreamGetProps)
|
||||
MY_QUERYINTERFACE_ENTRY(IStreamGetProps2)
|
||||
MY_QUERYINTERFACE_ENTRY(IStreamGetProp)
|
||||
MY_QUERYINTERFACE_END
|
||||
MY_ADDREF_RELEASE
|
||||
|
||||
@@ -74,6 +104,8 @@ public:
|
||||
STDMETHOD(GetSize)(UInt64 *size);
|
||||
STDMETHOD(GetProps)(UInt64 *size, FILETIME *cTime, FILETIME *aTime, FILETIME *mTime, UInt32 *attrib);
|
||||
STDMETHOD(GetProps2)(CStreamFileProps *props);
|
||||
STDMETHOD(GetProperty)(PROPID propID, PROPVARIANT *value);
|
||||
STDMETHOD(ReloadProps)();
|
||||
};
|
||||
|
||||
class CStdInFileStream:
|
||||
@@ -110,11 +142,11 @@ public:
|
||||
|
||||
UInt64 ProcessedSize;
|
||||
|
||||
bool SetTime(const FILETIME *cTime, const FILETIME *aTime, const FILETIME *mTime)
|
||||
bool SetTime(const CFiTime *cTime, const CFiTime *aTime, const CFiTime *mTime)
|
||||
{
|
||||
return File.SetTime(cTime, aTime, mTime);
|
||||
}
|
||||
bool SetMTime(const FILETIME *mTime) { return File.SetMTime(mTime); }
|
||||
bool SetMTime(const CFiTime *mTime) { return File.SetMTime(mTime); }
|
||||
|
||||
MY_UNKNOWN_IMP1(IOutStream)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user