...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::process::args
// In header: <boost/process/args.hpp> unspecified args;
The args
property allows to explicitly set arguments for the execution. The name of the executable will always be the first element in the arg-vector.
To set a the argument vector the following syntax can be used.
args = value; args(value);
std::initializer_list
is among the allowed types, so the following syntax is also possible.
args = {value1, value2}; args({value1, value2});
Below the possible types for value
are listed, with char_type
being either char
or wchar_t
.
To append a the argument vector the following syntax can be used.
args += value;
std::initializer_list
is among the allowed types, so the following syntax is also possible.
args += {value1, value2};
Below the possible types for value
are listed, with char_type
being either char
or wchar_t
.
The overload form is used when more than one string is passed, from the second one forward. I.e. the following expressions have the same results:
spawn("gcc", "--version"); spawn("gcc", args ="--version"); spawn("gcc", args+="--version"); spawn("gcc", args ={"--version"}); spawn("gcc", args+={"--version"});
Note | |
---|---|
A string will be parsed and set in quotes if it has none and contains spaces. |