#include <system.hh>
Iterate over our setenvs. | |
typedef WrappedForwardIterator < ConstIteratorTag, const std::pair< const std::string, std::string > > | ConstIterator |
ConstIterator | begin_setenvs () const |
ConstIterator | end_setenvs () const |
Basic operations | |
Command (const std::string &) | |
Command (const char *const) | |
Command (const Command &) | |
const Command & | operator= (const Command &) |
~Command () | |
Change command execution options | |
Command & | with_chdir (const FSEntry &) |
Command & | with_setenv (const std::string &, const std::string &) |
Command & | with_clearenv () |
Command & | with_sandbox () |
Command & | with_sydbox () |
Command & | with_echo_to_stderr () |
Command & | with_uid_gid (const uid_t, const gid_t) |
Command & | with_stdout_prefix (const std::string &) |
Command & | with_stderr_prefix (const std::string &) |
Command & | with_prefix_discard_blank_output () |
Command & | with_prefix_blank_lines () |
Command & | with_pipe_command_handler (const std::tr1::function< std::string(const std::string &)> &) |
Command & | with_captured_stdout_stream (std::ostream *const) |
Command & | with_captured_stderr_stream (std::ostream *const) |
Command & | with_input_stream (std::istream *const, int fd, const std::string &env_var) |
Command & | with_ptys () |
Fetch command execution options | |
std::string | command () const |
std::string | chdir () const |
void | echo_to_stderr () const |
std::tr1::shared_ptr< const uid_t > | uid () const |
std::tr1::shared_ptr< const gid_t > | gid () const |
std::string | stdout_prefix () const |
std::string | stderr_prefix () const |
bool | prefix_discard_blank_output () const |
bool | prefix_blank_lines () const |
std::ostream * | captured_stdout_stream () const |
std::ostream * | captured_stderr_stream () const |
std::istream * | input_stream () const |
int | input_fd () const |
const std::string | input_fd_env_var () const |
bool | ptys () const |
bool | clearenv () const |
Include a chdir before we run our command.
Command& paludis::Command::with_setenv | ( | const std::string & | , | |
const std::string & | ||||
) |
Add a setenv before we run our command.
Command& paludis::Command::with_clearenv | ( | ) |
Remove (most) existing environment variables before setting those added with with_setenv.
Command& paludis::Command::with_sandbox | ( | ) |
Run our command sandboxed.
Command& paludis::Command::with_sydbox | ( | ) |
Run our command sydboxed
Command& paludis::Command::with_echo_to_stderr | ( | ) |
Echo the command to be run to stderr before running it.
Command& paludis::Command::with_uid_gid | ( | const | uid_t, | |
const | gid_t | |||
) |
Add a setuid and setgid before running our command.
Command& paludis::Command::with_stdout_prefix | ( | const std::string & | ) |
Prefix stdout output with this.
Command& paludis::Command::with_stderr_prefix | ( | const std::string & | ) |
Prefix stderr output with this.
Command& paludis::Command::with_prefix_discard_blank_output | ( | ) |
If prefixing, and if the output contains only blanks, don't display any output.
Command& paludis::Command::with_prefix_blank_lines | ( | ) |
If prefixing, prefix blank lines too.
Command& paludis::Command::with_pipe_command_handler | ( | const std::tr1::function< std::string(const std::string &)> & | ) |
Specify a pipe command handler.
Command& paludis::Command::with_captured_stdout_stream | ( | std::ostream * | const | ) |
Specify a stream to which stdout is captured and written.
Command& paludis::Command::with_captured_stderr_stream | ( | std::ostream * | const | ) |
Specify a stream to which stderr is captured and written.
Command& paludis::Command::with_input_stream | ( | std::istream * | const, | |
int | fd, | |||
const std::string & | env_var | |||
) |
Send the contents of a stream in via a particular FD.
May only be called once.
fd | Send the stream to this FD. If -1, pick an unused FD. | |
env_var | If not empty, put the FD chosen in this env var. |
Command& paludis::Command::with_ptys | ( | ) |
Use ptys instead of pipes to capture stdout and/or stderr.
std::string paludis::Command::command | ( | ) | const |
Our command, as a string.
std::string paludis::Command::chdir | ( | ) | const |
Where to chdir, as a string.
void paludis::Command::echo_to_stderr | ( | ) | const |
Echo ourself to stderr.
std::tr1::shared_ptr<const uid_t> paludis::Command::uid | ( | ) | const |
The uid for setuid.
std::tr1::shared_ptr<const gid_t> paludis::Command::gid | ( | ) | const |
The gid for setgid.
std::string paludis::Command::stdout_prefix | ( | ) | const |
The stdout prefix.
std::string paludis::Command::stderr_prefix | ( | ) | const |
The stderr prefix.
bool paludis::Command::prefix_discard_blank_output | ( | ) | const |
If prefixing, and if the output contains only blanks, don't display any output?
bool paludis::Command::prefix_blank_lines | ( | ) | const |
Prefix blank lines?
std::ostream* paludis::Command::captured_stdout_stream | ( | ) | const |
The captured stdout stream, or null.
std::ostream* paludis::Command::captured_stderr_stream | ( | ) | const |
The captured stderr stream, or null.
std::istream* paludis::Command::input_stream | ( | ) | const |
The input stream, or null.
int paludis::Command::input_fd | ( | ) | const |
const std::string paludis::Command::input_fd_env_var | ( | ) | const |
bool paludis::Command::ptys | ( | ) | const |
Uses ptys instead of pipes?
bool paludis::Command::clearenv | ( | ) | const |
Should we clear existing environment variables?