#include <command.h>
Public Member Functions | |
Command (const miniXml::ustring &cmd) | |
Command () | |
void | setCommand (const miniXml::ustring &cmd) |
void | add (const miniXml::ustring &arg) |
add an argument to the command line | |
void | add (const miniXml::ustring &var, const miniXml::ustring &val) |
add an environement variable | |
bool | execSync (miniXml::ustring &out, miniXml::ustring &err) |
Execute this Command synchronously. | |
bool | execASync (int &out, int &err, int &in) |
Execute this Command asynchronously. | |
const boost::filesystem::path & | getWorkingDir () |
void | setWorkingDir (const boost::filesystem::path &dir) |
unsigned int | getPid () |
int | getReturnValue () |
bool | wait () |
Wait for the end of the execution of the command. | |
void | kill (int signal=9) |
Static Public Member Functions | |
static int | exec (const miniXml::ustring &cmd, miniXml::ustring &out, miniXml::ustring &err) |
static void | argsFromString (const miniXml::ustring &str, std::vector< miniXml::ustring > &args) |
separate an arguments string in a vector of substring |
Spm::Util::Command::Command | ( | const miniXml::ustring & | cmd | ) |
cmd | The command to run |
Spm::Util::Command::Command | ( | ) |
void Spm::Util::Command::setCommand | ( | const miniXml::ustring & | cmd | ) |
void Spm::Util::Command::add | ( | const miniXml::ustring & | arg | ) |
add an argument to the command line
arg | The arg to add |
void Spm::Util::Command::add | ( | const miniXml::ustring & | var, | |
const miniXml::ustring & | val | |||
) |
add an environement variable
var | The name of the variable | |
val | The value of the variable |
bool Spm::Util::Command::execSync | ( | miniXml::ustring & | out, | |
miniXml::ustring & | err | |||
) |
Execute this Command synchronously.
out | The output of this command | |
err | The error of this command |
bool Spm::Util::Command::execASync | ( | int & | out, | |
int & | err, | |||
int & | in | |||
) |
Execute this Command asynchronously.
out | The output stream of the launched command | |
err | The err stream of the launched command | |
in | The input stream of the launched command |
const boost::filesystem::path& Spm::Util::Command::getWorkingDir | ( | ) |
void Spm::Util::Command::setWorkingDir | ( | const boost::filesystem::path & | dir | ) |
dir | The directory from where this Command will be executed |
unsigned int Spm::Util::Command::getPid | ( | ) |
int Spm::Util::Command::getReturnValue | ( | ) |
static int Spm::Util::Command::exec | ( | const miniXml::ustring & | cmd, | |
miniXml::ustring & | out, | |||
miniXml::ustring & | err | |||
) | [static] |
bool Spm::Util::Command::wait | ( | ) |
Wait for the end of the execution of the command.
void Spm::Util::Command::kill | ( | int | signal = 9 |
) |
static void Spm::Util::Command::argsFromString | ( | const miniXml::ustring & | str, | |
std::vector< miniXml::ustring > & | args | |||
) | [static] |
separate an arguments string in a vector of substring
str | The string to separate | |
args | The vector of arguments |