diff options
Diffstat (limited to 'CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp')
-rw-r--r--[-rwxr-xr-x] | CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp b/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp index 8f830de5..ba41fd1a 100755..100644 --- a/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp +++ b/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp @@ -2,18 +2,21 @@ #include "StdAfx.h" -#include "Windows/FileDir.h" -#include "Windows/FileName.h" -#include "Windows/Thread.h" +#include "../../../Windows/FileDir.h" +#include "../../../Windows/FileName.h" +#include "../../../Windows/Thread.h" #include "../../UI/Common/OpenArchive.h" #include "../../UI/FileManager/FormatUtils.h" +#include "../../UI/FileManager/LangUtils.h" -#include "ExtractCallback.h" +#include "ExtractCallbackSfx.h" #include "ExtractEngine.h" using namespace NWindows; +using namespace NFile; +using namespace NDir; static LPCWSTR kCantFindArchive = L"Can not find archive file"; static LPCWSTR kCantOpenArchive = L"Can not open the file as archive"; @@ -33,15 +36,23 @@ struct CThreadExtracting void Process2() { - NFile::NFind::CFileInfo fi; + NFind::CFileInfo fi; if (!fi.Find(FileName)) { ErrorMessage = kCantFindArchive; Result = E_FAIL; return; } + + CObjectVector<COpenType> incl; + CIntVector excl; + COpenOptions options; + options.codecs = Codecs; + options.types = &incl; + options.excludedFormats = ! + options.filePath = fs2us(FileName); - Result = ArchiveLink.Open2(Codecs, CIntVector(), false, NULL, fs2us(FileName), ExtractCallbackSpec); + Result = ArchiveLink.Open2(options, ExtractCallbackSpec); if (Result != S_OK) { if (Result != S_OK) @@ -50,9 +61,9 @@ struct CThreadExtracting } FString dirPath = DestFolder; - NFile::NName::NormalizeDirPathPrefix(dirPath); + NName::NormalizeDirPathPrefix(dirPath); - if (!NFile::NDirectory::CreateComplexDirectory(dirPath)) + if (!CreateComplexDir(dirPath)) { ErrorMessage = MyFormatNew(IDS_CANNOT_CREATE_FOLDER, #ifdef LANG @@ -65,7 +76,7 @@ struct CThreadExtracting ExtractCallbackSpec->Init(ArchiveLink.GetArchive(), dirPath, L"Default", fi.MTime, 0); - Result = ArchiveLink.GetArchive()->Extract(0, (UInt32)-1 , BoolToInt(false), ExtractCallback); + Result = ArchiveLink.GetArchive()->Extract(0, (UInt32)(Int32)-1 , BoolToInt(false), ExtractCallback); } void Process() @@ -109,11 +120,7 @@ HRESULT ExtractArchive(CCodecs *codecs, const FString &fileName, const FString & RINOK(thread.Create(CThreadExtracting::MyThreadFunction, &t)); UString title; - #ifdef LANG - title = LangLoadString(IDS_PROGRESS_EXTRACTING, 0x02000890); - #else - title = NWindows::MyLoadStringW(IDS_PROGRESS_EXTRACTING); - #endif + LangString(IDS_PROGRESS_EXTRACTING, title); t.ExtractCallbackSpec->StartProgressDialog(title, thread); } else |