X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=lzma%2FCPP%2F7zip%2FUI%2FCommon%2FArchiveCommandLine.h;fp=lzma%2FCPP%2F7zip%2FUI%2FCommon%2FArchiveCommandLine.h;h=5f54b064b7022ab3b0f333ef8177ad17bfd0db89;hb=1a2e54b98aaab3669eebd38facb83687c4ac7baf;hp=0000000000000000000000000000000000000000;hpb=0b9bdac28929054558b5d7f315403fe3399a1413;p=physicsfs diff --git a/lzma/CPP/7zip/UI/Common/ArchiveCommandLine.h b/lzma/CPP/7zip/UI/Common/ArchiveCommandLine.h new file mode 100644 index 0000000..5f54b06 --- /dev/null +++ b/lzma/CPP/7zip/UI/Common/ArchiveCommandLine.h @@ -0,0 +1,104 @@ +// ArchiveCommandLine.h + +#ifndef __ARCHIVECOMMANDLINE_H +#define __ARCHIVECOMMANDLINE_H + +#include "Common/Wildcard.h" +#include "Common/CommandLineParser.h" + +#include "Extract.h" +#include "Update.h" + +struct CArchiveCommandLineException: public AString +{ + CArchiveCommandLineException(const char *errorMessage): AString(errorMessage) {} +}; + +namespace NCommandType { enum EEnum +{ + kAdd = 0, + kUpdate, + kDelete, + kTest, + kExtract, + kFullExtract, + kList, + kBenchmark, + kInfo +};} + +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; + + #ifdef _WIN32 + bool LargePages; + #endif + + 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; + + bool TechMode; + // Extract + bool AppendName; + UString OutputDir; + NExtract::NOverwriteMode::EEnum OverwriteMode; + UStringVector ArchivePathsSorted; + UStringVector ArchivePathsFullSorted; + CObjectVector ExtractProperties; + + CUpdateOptions UpdateOptions; + UString ArcType; + bool EnablePercents; + + // Benchmark + UInt32 NumIterations; + UInt32 NumThreads; + UInt32 DictionarySize; + UString Method; + + + CArchiveCommandLineOptions(): StdInMode(false), StdOutMode(false) {}; +}; + +class CArchiveCommandLineParser +{ + NCommandLineParser::CParser parser; +public: + CArchiveCommandLineParser(); + void Parse1(const UStringVector &commandStrings, CArchiveCommandLineOptions &options); + void Parse2(CArchiveCommandLineOptions &options); +}; + +#endif