16 inline CommandLine::CommandLine (
int argc,
char* argv[])
17 : CommandLine{argc, (const char**)argv}
20 inline CommandLine::CommandLine (
int argc,
wchar_t* argv[])
21 : CommandLine{argc, (const wchar_t**)argv}
24 inline bool CommandLine::Has (
const Option& o)
const
26 for (Traversal::Iterator<String> argi = fArgs_.begin () + 1; argi != fArgs_.end (); ++argi) {
27 if (optional<pair<
bool, optional<String>>> oRes = ParseOneArg_ (o, &argi)) {
35 inline optional<String> CommandLine::GetArgument (
const Option& o)
const
38 auto r = get<Sequence<String>> (Get (o));
39 return r.empty () ? optional<String>{} : r[0];
47 Require (o.fSupportsArgument);
48 return get<Sequence<String>> (Get (o));
50 inline auto CommandLine::GetStringShellQuoting () const -> optional<StringShellQuoting>
52 return fShellStyleQuoting_;
54 inline void CommandLine::SetStringShellQuoting (
const optional<StringShellQuoting>& s)
56 fShellStyleQuoting_ = s;
60 [[deprecated (
"Since Stroika v3.0d6 use CommandLine class")]]
inline Sequence<String> ParseCommandLine (
const String& cmdLine)
62 return CommandLine{cmdLine}.GetArguments ();
64 [[deprecated (
"Since Stroika v3.0d6 use CommandLine class")]]
inline Sequence<String> ParseCommandLine (
int argc,
char* argv[])
66 return CommandLine{argc, argv}.GetArguments ();
68 [[deprecated (
"Since Stroika v3.0d6 use CommandLine class")]]
inline Sequence<String> ParseCommandLine (
int argc,
const char* argv[])
70 return CommandLine{argc, argv}.GetArguments ();
72 [[deprecated (
"Since Stroika v3.0d6 use CommandLine class")]]
inline Sequence<String> ParseCommandLine (
int argc,
wchar_t* argv[])
74 return CommandLine{argc, argv}.GetArguments ();
76 [[deprecated (
"Since Stroika v3.0d6 use CommandLine class")]]
inline Sequence<String> ParseCommandLine (
int argc,
const wchar_t* argv[])
78 return CommandLine{argc, argv}.GetArguments ();
81 [[deprecated (
"Since Stroika v3.0d6 use CommandLine class")]]
bool MatchesCommandLineArgument (
const String& actualArg,
const String& matchesArgPattern);
82 [[deprecated (
"Since Stroika v3.0d6 use CommandLine class")]]
bool MatchesCommandLineArgument (
const Iterable<String>& argList,
83 const String& matchesArgPattern);
84 [[deprecated (
"Since Stroika v3.0d6 use CommandLine class")]] optional<String>
85 MatchesCommandLineArgumentWithValue (
const String& actualArg,
const String& matchesArgPattern);
86 [[deprecated (
"Since Stroika v3.0d6 use CommandLine class")]] optional<String>
87 MatchesCommandLineArgumentWithValue (
const Iterable<String>& argList,
const String& matchesArgPattern);
A generalization of a vector: a container whose elements are keyed by the natural numbers.