29 if( s.find(
' ') == std::string::npos )
37 m_args = arg.
array() ;
40 m_exe = m_args.at(0U) ;
41 std::rotate( m_args.begin() , m_args.begin()+1U , m_args.end() ) ;
47 if( !m_exe.
empty() && !osNativelyRunnable() )
57 if( add_wrapper && !m_exe.
empty() && !osNativelyRunnable() )
77 std::string(
"[") + m_exe.str() +
"]" :
78 std::string(
"[") + m_exe.str() +
"] [" +
Str::join(
"] [",m_args) +
"]" ;
83 m_args.push_back( arg ) ;
A class which holds a represention of the argc/argv command line array, and supports simple command-l...
StringArray array(unsigned int shift=0U) const
Returns the arguments as a string array, with an optional shift.
void parse(HINSTANCE hinstance, const std::string &command_line_tail)
Parses the given command-line tail, splitting it up into an array of tokens.
ExecutableCommand(const std::string &command_line=std::string())
Constructor taking a complete command-line.
void add(const std::string &arg)
Adds a command-line argument.
StringArray args() const
Returns the command-line arguments.
std::string displayString() const
Returns a printable representation for logging and diagnostics.
Path exe() const
Returns the executable.
A Path object represents a file system path.
bool empty() const noexcept
Returns true if size() is zero.
static std::string join(const std::string &sep, const StringArray &strings)
Concatenates an array of strings with separators.
std::vector< std::string > StringArray
A std::vector of std::strings.