This commit is contained in:
Igor Pavlov
2005-05-30 00:00:00 +00:00
committed by Kornel Lesiński
parent 8c1b5c7b7e
commit 3c510ba80b
926 changed files with 40559 additions and 23519 deletions

View File

@@ -0,0 +1,84 @@
// ArchiveCommandLine.h
#ifndef __ARCHIVECOMMANDLINE_H
#define __ARCHIVECOMMANDLINE_H
#include "Common/Wildcard.h"
#include "Common/CommandLineParser.h"
#include "Extract.h"
#include "Update.h"
namespace NCommandType { enum EEnum
{
kAdd = 0,
kUpdate,
kDelete,
kTest,
kExtract,
kFullExtract,
kList
};}
namespace NRecursedType { enum EEnum
{
kRecursed,
kWildCardOnlyRecursed,
kNonRecursed,
};}
struct CArchiveCommand
{
NCommandType::EEnum CommandType;
bool IsFromExtractGroup() const;
bool IsFromUpdateGroup() const;
bool IsTestMode() const { return CommandType == NCommandType::kTest; }
NExtract::NPathMode::EEnum GetPathMode() const;
};
struct CArchiveCommandLineOptions
{
bool HelpMode;
bool IsInTerminal;
bool IsStdOutTerminal;
bool IsStdErrTerminal;
bool StdInMode;
bool StdOutMode;
bool EnableHeaders;
bool YesToAll;
bool ShowDialog;
// NWildcard::CCensor ArchiveWildcardCensor;
NWildcard::CCensor WildcardCensor;
CArchiveCommand Command;
UString ArchiveName;
bool PasswordEnabled;
UString Password;
// Extract
bool AppendName;
UString OutputDir;
NExtract::NOverwriteMode::EEnum OverwriteMode;
UStringVector ArchivePathsSorted;
UStringVector ArchivePathsFullSorted;
CUpdateOptions UpdateOptions;
bool EnablePercents;
CArchiveCommandLineOptions(): StdInMode(false), StdOutMode(false) {};
};
class CArchiveCommandLineParser
{
NCommandLineParser::CParser parser;
public:
CArchiveCommandLineParser();
void Parse1(const UStringVector commandStrings, CArchiveCommandLineOptions &options);
void Parse2(CArchiveCommandLineOptions &options);
};
#endif