This commit is contained in:
Igor Pavlov
2014-11-23 00:00:00 +00:00
committed by Kornel Lesiński
parent 83f8ddcc5b
commit f08f4dcc3c
1158 changed files with 76451 additions and 35082 deletions

35
CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp Executable file → Normal file
View File

@@ -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 = &excl;
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