summaryrefslogtreecommitdiffstats
path: root/other-licenses/7zstub/src/7zip/UI/Common/ArchiveOpenCallback.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-03-29 16:04:01 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-03-29 16:04:01 +0100
commit88083f8c683c18f4de68a20c863a82a9da65db8f (patch)
tree926656892d9d80260da02ea8ea71031b140c51df /other-licenses/7zstub/src/7zip/UI/Common/ArchiveOpenCallback.cpp
parentf999f544aad04069b03704d994a99352263f600b (diff)
parent843e4ceffd6ce21a6e6db37419335eafdc543e18 (diff)
downloadUXP-88083f8c683c18f4de68a20c863a82a9da65db8f.tar
UXP-88083f8c683c18f4de68a20c863a82a9da65db8f.tar.gz
UXP-88083f8c683c18f4de68a20c863a82a9da65db8f.tar.lz
UXP-88083f8c683c18f4de68a20c863a82a9da65db8f.tar.xz
UXP-88083f8c683c18f4de68a20c863a82a9da65db8f.zip
Merge branch 'master' into Sync-weave
Diffstat (limited to 'other-licenses/7zstub/src/7zip/UI/Common/ArchiveOpenCallback.cpp')
-rw-r--r--other-licenses/7zstub/src/7zip/UI/Common/ArchiveOpenCallback.cpp117
1 files changed, 0 insertions, 117 deletions
diff --git a/other-licenses/7zstub/src/7zip/UI/Common/ArchiveOpenCallback.cpp b/other-licenses/7zstub/src/7zip/UI/Common/ArchiveOpenCallback.cpp
deleted file mode 100644
index bef05786b..000000000
--- a/other-licenses/7zstub/src/7zip/UI/Common/ArchiveOpenCallback.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-// ArchiveOpenCallback.cpp
-
-#include "StdAfx.h"
-
-#include "ArchiveOpenCallback.h"
-
-#include "Common/StringConvert.h"
-#include "Windows/PropVariant.h"
-
-#include "../../Common/FileStreams.h"
-
-using namespace NWindows;
-
-STDMETHODIMP COpenCallbackImp::SetTotal(const UInt64 *files, const UInt64 *bytes)
-{
- return Callback->SetTotal(files, bytes);
-}
-
-STDMETHODIMP COpenCallbackImp::SetCompleted(const UInt64 *files, const UInt64 *bytes)
-{
- return Callback->SetTotal(files, bytes);
-}
-
-STDMETHODIMP COpenCallbackImp::GetProperty(PROPID propID, PROPVARIANT *value)
-{
- NCOM::CPropVariant propVariant;
- if (_subArchiveMode)
- {
- switch(propID)
- {
- case kpidName:
- propVariant = _subArchiveName;
- break;
- }
- propVariant.Detach(value);
- return S_OK;
- }
- switch(propID)
- {
- case kpidName:
- propVariant = _fileInfo.Name;
- break;
- case kpidIsFolder:
- propVariant = _fileInfo.IsDirectory();
- break;
- case kpidSize:
- propVariant = _fileInfo.Size;
- break;
- case kpidAttributes:
- propVariant = (UInt32)_fileInfo.Attributes;
- break;
- case kpidLastAccessTime:
- propVariant = _fileInfo.LastAccessTime;
- break;
- case kpidCreationTime:
- propVariant = _fileInfo.CreationTime;
- break;
- case kpidLastWriteTime:
- propVariant = _fileInfo.LastWriteTime;
- break;
- }
- propVariant.Detach(value);
- return S_OK;
-}
-
-int COpenCallbackImp::FindName(const UString &name)
-{
- for (int i = 0; i < FileNames.Size(); i++)
- if (name.CompareNoCase(FileNames[i]) == 0)
- return i;
- return -1;
-}
-
-struct CInFileStreamVol: public CInFileStream
-{
- UString Name;
- COpenCallbackImp *OpenCallbackImp;
- CMyComPtr<IArchiveOpenCallback> OpenCallbackRef;
- ~CInFileStreamVol()
- {
- int index = OpenCallbackImp->FindName(Name);
- if (index >= 0)
- OpenCallbackImp->FileNames.Delete(index);
- }
-};
-
-STDMETHODIMP COpenCallbackImp::GetStream(const wchar_t *name,
- IInStream **inStream)
-{
- if (_subArchiveMode)
- return S_FALSE;
- RINOK(Callback->CheckBreak());
- *inStream = NULL;
- UString fullPath = _folderPrefix + name;
- if (!NFile::NFind::FindFile(fullPath, _fileInfo))
- return S_FALSE;
- if (_fileInfo.IsDirectory())
- return S_FALSE;
- CInFileStreamVol *inFile = new CInFileStreamVol;
- CMyComPtr<IInStream> inStreamTemp = inFile;
- if (!inFile->Open(fullPath))
- return ::GetLastError();
- *inStream = inStreamTemp.Detach();
- inFile->Name = name;
- inFile->OpenCallbackImp = this;
- inFile->OpenCallbackRef = this;
- FileNames.Add(name);
- return S_OK;
-}
-
-#ifndef _NO_CRYPTO
-STDMETHODIMP COpenCallbackImp::CryptoGetTextPassword(BSTR *password)
-{
- return Callback->CryptoGetTextPassword(password);
-}
-#endif
-