29 if( s.find(
' ') == std::string::npos )
36 const std::string null( 1U ,
'\0' ) ;
43 for( G::StringArray::iterator p = m_args.begin() ; p != m_args.end() ; ++p )
51 m_exe =
G::Path( m_args.at(0U) ) ;
52 std::rotate( m_args.begin() , m_args.begin()+1U , m_args.end() ) ;
58 if( m_exe !=
G::Path() && !osNativelyRunnable() )
84 std::string(
"[") + m_exe.str() +
"] [" +
G::Str::join(
"] [",m_args) +
"]" :
85 std::string(
"[") + m_exe.str() +
"]" ;
90 m_args.push_back( arg ) ;
std::vector< std::string > StringArray
A std::vector of std::strings.
static void splitIntoTokens(const std::string &in, StringArray &out, const std::string &ws)
Splits the string into 'ws'-delimited tokens.
static unsigned int replaceAll(std::string &s, const std::string &from, const std::string &to)
Does a global replace on string 's', replacing all occurances of sub-string 'from' with 'to'...
StringArray args() const
Returns the command-line arguments.
static std::string join(const std::string &sep, const StringArray &strings)
Concatenates an array of strings.
Executable(const std::string &command_line=std::string())
Constructor taking a complete command-line.
std::string displayString() const
Returns a printable representation for logging and diagnostics.
void add(const std::string &arg)
Adds a command-line argument.
A Path object represents a file system path.
Path exe() const
Returns the executable.