mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-10 22:07:08 -06:00
4.59 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
3901bf0ab8
commit
173c07e166
@@ -35,7 +35,7 @@ using namespace NCommandLineParser;
|
||||
|
||||
extern CStdOutStream *g_StdStream;
|
||||
|
||||
static const char *kCopyrightString =
|
||||
static const char *kCopyrightString =
|
||||
"\n7-Zip SFX " MY_VERSION_COPYRIGHT_DATE "\n";
|
||||
|
||||
static const int kNumSwitches = 6;
|
||||
@@ -63,17 +63,17 @@ enum EEnum
|
||||
{
|
||||
kRecursed,
|
||||
kWildCardOnlyRecursed,
|
||||
kNonRecursed,
|
||||
kNonRecursed
|
||||
};
|
||||
}
|
||||
/*
|
||||
/*
|
||||
static const char kRecursedIDChar = 'R';
|
||||
static const wchar_t *kRecursedPostCharSet = L"0-";
|
||||
|
||||
namespace NRecursedPostCharIndex {
|
||||
enum EEnum
|
||||
enum EEnum
|
||||
{
|
||||
kWildCardRecursionOnly = 0,
|
||||
kWildCardRecursionOnly = 0,
|
||||
kNoRecursion = 1
|
||||
};
|
||||
}
|
||||
@@ -84,7 +84,7 @@ static const char kImmediateNameID = '!';
|
||||
static const char kSomeCludePostStringMinSize = 2; // at least <@|!><N>ame must be
|
||||
static const char kSomeCludeAfterRecursedPostStringMinSize = 2; // at least <@|!><N>ame must be
|
||||
*/
|
||||
static const CSwitchForm kSwitchForms[kNumSwitches] =
|
||||
static const CSwitchForm kSwitchForms[kNumSwitches] =
|
||||
{
|
||||
{ L"?", NSwitchType::kSimple, false },
|
||||
{ L"H", NSwitchType::kSimple, false },
|
||||
@@ -107,7 +107,7 @@ enum EEnum
|
||||
|
||||
}
|
||||
|
||||
static const CCommandForm commandForms[kNumCommandForms] =
|
||||
static const CCommandForm commandForms[kNumCommandForms] =
|
||||
{
|
||||
{ L"T", false },
|
||||
// { "E", false },
|
||||
@@ -115,7 +115,7 @@ static const CCommandForm commandForms[kNumCommandForms] =
|
||||
{ L"L", false }
|
||||
};
|
||||
|
||||
static const NRecursedType::EEnum kCommandRecursedDefault[kNumCommandForms] =
|
||||
static const NRecursedType::EEnum kCommandRecursedDefault[kNumCommandForms] =
|
||||
{
|
||||
NRecursedType::kRecursed
|
||||
};
|
||||
@@ -126,7 +126,7 @@ static const NRecursedType::EEnum kCommandRecursedDefault[kNumCommandForms] =
|
||||
static const wchar_t *kUniversalWildcard = L"*";
|
||||
static const int kCommandIndex = 0;
|
||||
|
||||
static const char *kHelpString =
|
||||
static const char *kHelpString =
|
||||
"\nUsage: 7zSFX [<command>] [<switches>...]\n"
|
||||
"\n"
|
||||
"<Commands>\n"
|
||||
@@ -188,7 +188,7 @@ bool ParseArchiveCommand(const UString &commandString, CArchiveCommand &command)
|
||||
UString commandStringUpper = commandString;
|
||||
commandStringUpper.MakeUpper();
|
||||
UString postString;
|
||||
int commandIndex = ParseCommand(kNumCommandForms, commandForms, commandStringUpper,
|
||||
int commandIndex = ParseCommand(kNumCommandForms, commandForms, commandStringUpper,
|
||||
postString) ;
|
||||
if (commandIndex < 0)
|
||||
return false;
|
||||
@@ -199,7 +199,7 @@ bool ParseArchiveCommand(const UString &commandString, CArchiveCommand &command)
|
||||
// ------------------------------------------------------------------
|
||||
// filenames functions
|
||||
|
||||
static bool AddNameToCensor(NWildcard::CCensor &wildcardCensor,
|
||||
static bool AddNameToCensor(NWildcard::CCensor &wildcardCensor,
|
||||
const UString &name, bool include, NRecursedType::EEnum type)
|
||||
{
|
||||
/*
|
||||
@@ -225,15 +225,15 @@ static bool AddNameToCensor(NWildcard::CCensor &wildcardCensor,
|
||||
return true;
|
||||
}
|
||||
|
||||
void AddCommandLineWildCardToCensor(NWildcard::CCensor &wildcardCensor,
|
||||
void AddCommandLineWildCardToCensor(NWildcard::CCensor &wildcardCensor,
|
||||
const UString &name, bool include, NRecursedType::EEnum type)
|
||||
{
|
||||
if (!AddNameToCensor(wildcardCensor, name, include, type))
|
||||
ShowMessageAndThrowException(kIncorrectWildCardInCommandLine, NExitCode::kUserError);
|
||||
}
|
||||
|
||||
void AddToCensorFromNonSwitchesStrings(NWildcard::CCensor &wildcardCensor,
|
||||
const UStringVector & /* nonSwitchStrings */, NRecursedType::EEnum type,
|
||||
void AddToCensorFromNonSwitchesStrings(NWildcard::CCensor &wildcardCensor,
|
||||
const UStringVector & /* nonSwitchStrings */, NRecursedType::EEnum type,
|
||||
bool /* thereAreSwitchIncludeWildCards */)
|
||||
{
|
||||
AddCommandLineWildCardToCensor(wildcardCensor, kUniversalWildcard, true, type);
|
||||
@@ -253,19 +253,19 @@ static void GetArguments(int numArguments, const char *arguments[], UStringVecto
|
||||
#endif
|
||||
|
||||
int Main2(
|
||||
#ifndef _WIN32
|
||||
#ifndef _WIN32
|
||||
int numArguments, const char *arguments[]
|
||||
#endif
|
||||
)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#ifdef _WIN32
|
||||
SetFileApisToOEM();
|
||||
#endif
|
||||
|
||||
g_StdOut << kCopyrightString;
|
||||
|
||||
UStringVector commandStrings;
|
||||
#ifdef _WIN32
|
||||
#ifdef _WIN32
|
||||
NCommandLineParser::SplitCommandLine(GetCommandLineW(), commandStrings);
|
||||
#else
|
||||
GetArguments(numArguments, arguments, commandStrings);
|
||||
@@ -280,7 +280,7 @@ int Main2(
|
||||
{
|
||||
parser.ParseStrings(kSwitchForms, commandStrings);
|
||||
}
|
||||
catch(...)
|
||||
catch(...)
|
||||
{
|
||||
PrintHelpAndExit();
|
||||
}
|
||||
@@ -297,7 +297,7 @@ int Main2(
|
||||
CArchiveCommand command;
|
||||
if (numNonSwitchStrings == 0)
|
||||
command.CommandType = NCommandType::kFullExtract;
|
||||
else
|
||||
else
|
||||
{
|
||||
if (numNonSwitchStrings > 1)
|
||||
PrintHelpAndExit();
|
||||
@@ -335,7 +335,7 @@ int Main2(
|
||||
NFind::CFileInfoW archiveFileInfo;
|
||||
if (!NFind::FindFile(archiveName, archiveFileInfo))
|
||||
throw kCantFindSFX;
|
||||
if (archiveFileInfo.IsDirectory())
|
||||
if (archiveFileInfo.IsDir())
|
||||
throw kCantFindSFX;
|
||||
|
||||
UString outputDir;
|
||||
@@ -349,7 +349,7 @@ int Main2(
|
||||
UStringVector v1, v2;
|
||||
v1.Add(archiveName);
|
||||
v2.Add(archiveName);
|
||||
const NWildcard::CCensorNode &wildcardCensorHead =
|
||||
const NWildcard::CCensorNode &wildcardCensorHead =
|
||||
wildcardCensor.Pairs.Front().Head;
|
||||
|
||||
CCodecs *codecs = new CCodecs;
|
||||
@@ -382,8 +382,8 @@ int Main2(
|
||||
eo.StdOutMode = false;
|
||||
eo.PathMode = NExtract::NPathMode::kFullPathnames;
|
||||
eo.TestMode = command.CommandType == NCommandType::kTest;
|
||||
eo.OverwriteMode = yesToAll ?
|
||||
NExtract::NOverwriteMode::kWithoutPrompt :
|
||||
eo.OverwriteMode = yesToAll ?
|
||||
NExtract::NOverwriteMode::kWithoutPrompt :
|
||||
NExtract::NOverwriteMode::kAskBefore;
|
||||
eo.OutputDir = outputDir;
|
||||
eo.YesToAll = yesToAll;
|
||||
@@ -391,9 +391,9 @@ int Main2(
|
||||
UString errorMessage;
|
||||
CDecompressStat stat;
|
||||
HRESULT result = DecompressArchives(
|
||||
codecs,
|
||||
codecs, CIntVector(),
|
||||
v1, v2,
|
||||
wildcardCensorHead,
|
||||
wildcardCensorHead,
|
||||
eo, &openCallback, ecs, errorMessage, stat);
|
||||
if (!errorMessage.IsEmpty())
|
||||
{
|
||||
@@ -417,11 +417,11 @@ int Main2(
|
||||
{
|
||||
UInt64 numErrors = 0;
|
||||
HRESULT result = ListArchives(
|
||||
codecs,
|
||||
codecs, CIntVector(),
|
||||
v1, v2,
|
||||
wildcardCensorHead,
|
||||
true, false,
|
||||
passwordEnabled,
|
||||
wildcardCensorHead,
|
||||
true, false,
|
||||
passwordEnabled,
|
||||
password, numErrors);
|
||||
if (numErrors > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user