9.04 beta

This commit is contained in:
Igor Pavlov
2009-06-02 00:00:00 +00:00
committed by Kornel Lesiński
parent 8874e4fbc9
commit 829409452d
440 changed files with 19803 additions and 9941 deletions

View File

@@ -2,15 +2,9 @@
#include "StdAfx.h"
#include <stdio.h>
#include "ExtractEngine.h"
#include "Common/Wildcard.h"
#include "Common/StringConvert.h"
#include "Windows/Defs.h"
#include "ExtractEngine.h"
#include "FarUtils.h"
#include "Messages.h"
#include "OverwriteDialog.h"
@@ -60,7 +54,7 @@ STDMETHODIMP CExtractCallBackImp::SetCompleted(const UInt64 *completeValue)
STDMETHODIMP CExtractCallBackImp::AskOverwrite(
const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
INT32 *answer)
Int32 *answer)
{
NOverwriteDialog::CFileInfo oldFileInfo, newFileInfo;
oldFileInfo.Time = *existTime;
@@ -108,7 +102,7 @@ STDMETHODIMP CExtractCallBackImp::AskOverwrite(
return S_OK;
}
STDMETHODIMP CExtractCallBackImp::PrepareOperation(const wchar_t *name, bool /* isFolder */, INT32 /* askExtractMode */, const UInt64 * /* position */)
STDMETHODIMP CExtractCallBackImp::PrepareOperation(const wchar_t *name, bool /* isFolder */, Int32 /* askExtractMode */, const UInt64 * /* position */)
{
if (WasEscPressed())
return E_ABORT;
@@ -124,7 +118,7 @@ STDMETHODIMP CExtractCallBackImp::MessageError(const wchar_t *message)
return S_OK;
}
STDMETHODIMP CExtractCallBackImp::SetOperationResult(INT32 operationResult, bool encrypted)
STDMETHODIMP CExtractCallBackImp::SetOperationResult(Int32 operationResult, bool encrypted)
{
switch(operationResult)
{

View File

@@ -27,11 +27,11 @@ public:
STDMETHOD(AskOverwrite)(
const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
INT32 *result);
STDMETHOD (PrepareOperation)(const wchar_t *name, bool isFolder, INT32 askExtractMode, const UInt64 *position);
Int32 *result);
STDMETHOD (PrepareOperation)(const wchar_t *name, bool isFolder, Int32 askExtractMode, const UInt64 *position);
STDMETHOD(MessageError)(const wchar_t *message);
STDMETHOD(SetOperationResult)(INT32 resultEOperationResult, bool encrypted);
STDMETHOD(SetOperationResult)(Int32 resultEOperationResult, bool encrypted);
// ICryptoGetTextPassword
STDMETHOD(CryptoGetTextPassword)(BSTR *password);
@@ -44,15 +44,6 @@ private:
UString m_CurrentFilePath;
/*
struct CProcessedFileInfo
{
FILETIME MTime;
bool isDir;
UINT32 Attributes;
} m_ProcessedFileInfo;
*/
CProgressBox *m_ProgressBox;
UINT m_CodePage;

View File

@@ -118,6 +118,10 @@ SOURCE=.\StdAfx.h
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\..\Common\CRC.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\IntToString.cpp
# End Source File
# Begin Source File
@@ -566,6 +570,15 @@ SOURCE=..\..\Common\StreamUtils.h
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\..\..\C\7zCrc.c
# SUBTRACT CPP /YX /Yc /Yu
# End Source File
# Begin Source File
SOURCE=..\..\..\..\C\7zCrc.h
# End Source File
# Begin Source File
SOURCE=..\..\..\..\C\Alloc.c
# SUBTRACT CPP /YX /Yc /Yu
# End Source File
@@ -592,5 +605,17 @@ SOURCE=..\..\..\..\C\Threads.c
SOURCE=..\..\..\..\C\Threads.h
# End Source File
# End Group
# Begin Group "Arc Common"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Archive\Common\OutStreamWithCRC.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Archive\Common\OutStreamWithCRC.h
# End Source File
# End Group
# End Target
# End Project

View File

@@ -173,11 +173,10 @@ public:
}
void ShowMessage();
void LoadFileInfo(const UString &folderPrefix,
const UString &fileName)
void LoadFileInfo(const UString &folderPrefix, const UString &fileName)
{
_folderPrefix = folderPrefix;
if (!NWindows::NFile::NFind::FindFile(_folderPrefix + fileName, _fileInfo))
if (!_fileInfo.Find(_folderPrefix + fileName))
throw 1;
}
};
@@ -297,7 +296,7 @@ STDMETHODIMP COpenArchiveCallback::GetStream(const wchar_t *name,
return E_ABORT;
*inStream = NULL;
UString fullPath = _folderPrefix + name;
if (!NWindows::NFile::NFind::FindFile(fullPath, _fileInfo))
if (!_fileInfo.Find(fullPath))
return S_FALSE;
if (_fileInfo.IsDir())
return S_FALSE;
@@ -386,7 +385,7 @@ static HANDLE MyOpenFilePlugin(const char *name)
int fileNamePartStartIndex;
NFile::NDirectory::MyGetFullPathName(normalizedName, fullName, fileNamePartStartIndex);
NFile::NFind::CFileInfoW fileInfo;
if (!NFile::NFind::FindFile(fullName, fileInfo))
if (!fileInfo.Find(fullName))
return INVALID_HANDLE_VALUE;
if (fileInfo.IsDir())
return INVALID_HANDLE_VALUE;
@@ -415,7 +414,7 @@ static HANDLE MyOpenFilePlugin(const char *name)
archiveHandler = new CAgent;
CMyComBSTR archiveType;
HRESULT result = archiveHandler->Open(
HRESULT result = archiveHandler->Open(NULL,
GetUnicodeString(fullName, CP_OEMCP), &archiveType, openArchiveCallback);
/*
HRESULT result = ::OpenArchive(fullName, &archiveHandler,

View File

@@ -64,6 +64,17 @@ enum EEnum
kChecksum,
kCharacts,
kVa,
kId,
kShortName,
kCreatorApp,
kSectorSize,
kPosixAttrib,
kLink,
kTotalSize,
kFreeSpace,
kClusterSize,
kLabel,
kGetPasswordTitle,
kEnterPasswordForFile,

View File

@@ -21,17 +21,14 @@ using namespace NWindows;
using namespace NFar;
CPlugin::CPlugin(const UString &fileName,
// const UString &defaultName,
IInFolderArchive *archiveHandler,
UString archiveTypeName
):
m_ArchiveHandler(archiveHandler),
m_FileName(fileName),
_archiveTypeName(archiveTypeName)
// , m_DefaultName(defaultName)
// , m_ArchiverInfo(archiverInfo)
{
if (!NFile::NFind::FindFile(m_FileName, m_FileInfo))
if (!m_FileInfo.Find(m_FileName))
throw "error";
archiveHandler->BindToRootFolder(&_folder);
}
@@ -324,7 +321,18 @@ static CPROPIDToName kPROPIDToName[] =
{ kpidHeadersSize, NMessageID::kHeadersSize },
{ kpidChecksum, NMessageID::kChecksum },
{ kpidCharacts, NMessageID::kCharacts },
{ kpidVa, NMessageID::kVa }
{ kpidVa, NMessageID::kVa },
{ kpidId, NMessageID::kId },
{ kpidShortName, NMessageID::kShortName},
{ kpidCreatorApp, NMessageID::kCreatorApp },
{ kpidSectorSize, NMessageID::kSectorSize },
{ kpidPosixAttrib, NMessageID::kPosixAttrib },
{ kpidLink, NMessageID::kLink },
{ kpidTotalSize, NMessageID::kTotalSize },
{ kpidFreeSpace, NMessageID::kFreeSpace },
{ kpidClusterSize, NMessageID::kClusterSize },
{ kpidVolumeName, NMessageID::kLabel }
};
static const int kNumPROPIDToName = sizeof(kPROPIDToName) / sizeof(kPROPIDToName[0]);

View File

@@ -40,7 +40,6 @@ class CPlugin
void GetCurrentDir();
public:
UString m_FileName;
// UString m_DefaultName;
NWindows::NFile::NFind::CFileInfoW m_FileInfo;
CMyComPtr<IInFolderArchive> m_ArchiveHandler;

View File

@@ -683,7 +683,7 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems)
CMyComPtr<IOutFolderArchive> outArchive;
CMyComPtr<IInFolderArchive> archiveHandler;
if(NFind::FindFile(fullArchiveName, fileInfo))
if(fileInfo.Find(fullArchiveName))
{
if (fileInfo.IsDir())
throw "There is Directory with such name";
@@ -692,7 +692,7 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems)
archiveHandler = agentSpec;
// CLSID realClassID;
CMyComBSTR archiveType;
RINOK(agentSpec->Open(
RINOK(agentSpec->Open(NULL,
GetUnicodeString(fullArchiveName, CP_OEMCP),
// &realClassID,
&archiveType,

View File

@@ -52,3 +52,15 @@ STDMETHODIMP CUpdateCallback100Imp::UpdateErrorMessage(const wchar_t *message)
return S_OK;
}
extern HRESULT GetPassword(UString &password);
STDMETHODIMP CUpdateCallback100Imp::CryptoGetTextPassword(BSTR *password)
{
*password = NULL;
if (!m_PasswordIsDefined)
{
RINOK(GetPassword(m_Password));
m_PasswordIsDefined = true;
}
return StringToBstr(m_Password, password);
}

View File

@@ -1,33 +1,40 @@
// UpdateCallback.h
#ifndef __UPDATECALLBACK100_H
#define __UPDATECALLBACK100_H
#ifndef __UPDATE_CALLBACK_H
#define __UPDATE_CALLBACK_H
#include "Common/MyCom.h"
#include "../Agent/IFolderArchive.h"
#include "../../IPassword.h"
#include "ProgressBox.h"
class CUpdateCallback100Imp:
public IFolderArchiveUpdateCallback,
public ICryptoGetTextPassword,
public CMyUnknownImp
{
// CMyComPtr<IInFolderArchive> _archiveHandler;
CProgressBox *_progressBox;
UInt64 _total;
bool m_PasswordIsDefined;
UString m_Password;
public:
MY_UNKNOWN_IMP
MY_UNKNOWN_IMP1(ICryptoGetTextPassword)
INTERFACE_IProgress(;)
INTERFACE_IFolderArchiveUpdateCallback(;)
STDMETHOD(CryptoGetTextPassword)(BSTR *password);
CUpdateCallback100Imp(): _total(0) {}
void Init(/* IInFolderArchive *archiveHandler, */ CProgressBox *progressBox)
{
// _archiveHandler = archiveHandler;
_progressBox = progressBox;
m_PasswordIsDefined = false;
}
};

View File

@@ -64,6 +64,9 @@ UI_COMMON_OBJS = \
$O\WorkDir.obj \
$O\ZipRegistry.obj \
AR_COMMON_OBJS = \
$O\OutStreamWithCRC.obj \
AGENT_OBJS = \
$O\Agent.obj \
$O\AgentOut.obj \
@@ -75,6 +78,8 @@ C_OBJS = \
$O\Sort.obj \
$O\Threads.obj \
!include "../../Crc2.mak"
OBJS = \
$O\StdAfx.obj \
$(FAR_OBJS) \
@@ -82,9 +87,11 @@ OBJS = \
$(WIN_OBJS) \
$(7ZIP_COMMON_OBJS) \
$(UI_COMMON_OBJS) \
$(AR_COMMON_OBJS) \
$(AGENT_OBJS) \
$(C_OBJS) \
$O\CopyCoder.obj \
$(CRC_OBJS) \
$O\resource.res
!include "../../../Build.mak"
@@ -99,9 +106,12 @@ $(7ZIP_COMMON_OBJS): ../../Common/$(*B).cpp
$(COMPL)
$(UI_COMMON_OBJS): ../Common/$(*B).cpp
$(COMPL)
$(AR_COMMON_OBJS): ../../Archive/Common/$(*B).cpp
$(COMPL)
$(AGENT_OBJS): ../Agent/$(*B).cpp
$(COMPL)
$O\CopyCoder.obj: ../../Compress/$(*B).cpp
$(COMPL)
$(C_OBJS): ../../../../C/$(*B).c
$(COMPL_O2)
!include "../../Crc.mak"