1 // Common/CommandLineParser.h
3 #ifndef __COMMON_COMMANDLINEPARSER_H
4 #define __COMMON_COMMANDLINEPARSER_H
8 namespace NCommandLineParser {
10 void SplitCommandLine(const UString &src, UString &dest1, UString &dest2);
11 void SplitCommandLine(const UString &s, UStringVector &parts);
13 namespace NSwitchType {
26 const wchar_t *IDString;
27 NSwitchType::EEnum Type;
31 const wchar_t *PostCharSet;
38 UStringVector PostStrings;
40 CSwitchResult(): ThereIs(false) {};
46 CSwitchResult *_switches;
47 bool ParseString(const UString &s, const CSwitchForm *switchForms);
49 UStringVector NonSwitchStrings;
50 CParser(int numSwitches);
52 void ParseStrings(const CSwitchForm *switchForms,
53 const UStringVector &commandStrings);
54 const CSwitchResult& operator[](size_t index) const;
57 /////////////////////////////////
58 // Command parsing procedures
66 // Returns: Index of form and postString; -1, if there is no match
67 int ParseCommand(int numCommandForms, const CCommandForm *commandForms,
68 const UString &commandString, UString &postString);