50 explicit CommandLine(
const std::string& argv0,
const std::vector<std::string>& args = {})
51 : m_argv0{argv0}, m_args{args} {}
58 explicit CommandLine(std::string&& argv0, std::vector<std::string>&& args = {})
59 : m_argv0{std::move(argv0)}, m_args{std::move(args)} {}
65 explicit CommandLine(std::vector<std::string> argv);
67 static std::string escape(
const std::string&);
69 static std::string escape_cmd(
const std::string&);
96 const std::vector<std::string>&
get_args()
const {
return m_args; }
102 std::vector<std::string>
get_argv()
const;
105 static constexpr
char token_sep() {
return ' '; }
107 std::string escape_argv0()
const {
return escape(
get_argv0()); }
109 std::vector<std::string> escape_args()
const;
111 std::vector<std::string> escape_argv()
const;
114 std::vector<std::string> m_args;
Command line for the current process or for launching new processes.
static CommandLine from_main(int argc, wchar_t *argv[])
std::string get_argv0() const
CommandLine(const std::string &argv0, const std::vector< std::string > &args={})
static CommandLine query()
static CommandLine parse(const std::string &src)
CommandLine(std::string &&argv0, std::vector< std::string > &&args={})
std::vector< std::string > get_argv() const
std::string to_string() const
const std::vector< std::string > & get_args() const
std::string args_to_string() const