paludis::Command Class Reference
[System]

#include <system.hh>

Inheritance diagram for paludis::Command:

paludis::PrivateImplementationPattern< C_ >

List of all members.

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 Commandoperator= (const Command &)
 ~Command ()

Change command execution options

Commandwith_chdir (const FSEntry &)
Commandwith_setenv (const std::string &, const std::string &)
Commandwith_clearenv ()
Commandwith_sandbox ()
Commandwith_sydbox ()
Commandwith_echo_to_stderr ()
Commandwith_uid_gid (const uid_t, const gid_t)
Commandwith_stdout_prefix (const std::string &)
Commandwith_stderr_prefix (const std::string &)
Commandwith_prefix_discard_blank_output ()
Commandwith_prefix_blank_lines ()
Commandwith_pipe_command_handler (const std::tr1::function< std::string(const std::string &)> &)
Commandwith_captured_stdout_stream (std::ostream *const)
Commandwith_captured_stderr_stream (std::ostream *const)
Commandwith_input_stream (std::istream *const, int fd, const std::string &env_var)
Commandwith_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


Detailed Description

A command to be run.

See also:
PStream

run_command


Member Function Documentation

Command& paludis::Command::with_chdir ( const FSEntry  ) 

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.

Since:
0.36

Command& paludis::Command::with_sandbox (  ) 

Run our command sandboxed.

Command& paludis::Command::with_sydbox (  ) 

Run our command sydboxed

Since:
0.38

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.

Since:
0.30

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.

Parameters:
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.
Since:
0.40

Command& paludis::Command::with_ptys (  ) 

Use ptys instead of pipes to capture stdout and/or stderr.

Since:
0.38

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.

Since:
0.30

std::istream* paludis::Command::input_stream (  )  const

The input stream, or null.

Since:
0.40

int paludis::Command::input_fd (  )  const

The input FD, if input_stream() not null.

Since:
0.40

const std::string paludis::Command::input_fd_env_var (  )  const

The input FD env var, if input_stream() not null.

Since:
0.40

bool paludis::Command::ptys (  )  const

Uses ptys instead of pipes?

Since:
0.38

bool paludis::Command::clearenv (  )  const

Should we clear existing environment variables?

Since:
0.36


The documentation for this class was generated from the following file:
Generated on Mon Sep 21 10:36:12 2009 for paludis by  doxygen 1.5.4