13 #ifndef ZYPP_EXTERNALPROGRAM_H 14 #define ZYPP_EXTERNALPROGRAM_H 93 bool use_pty =
false,
int stderr_fd = -1,
bool default_locale =
false,
122 bool use_pty =
false,
int stderr_fd = -1,
bool default_locale =
false,
127 bool use_pty =
false,
int stderr_fd = -1,
bool default_locale =
false,
132 bool use_pty =
false,
int stderr_fd = -1,
bool default_locale =
false,
137 bool use_pty =
false,
int stderr_fd = -1,
bool default_locale =
false,
209 std::ostream &
operator>>( std::ostream & out_r );
233 int stderr_fd = -1,
bool default_locale =
false,
234 const char* root = NULL,
bool switch_pgid =
false);
239 namespace externalprogram
288 bool stderrGetUpTo( std::string & retval_r,
const char delim_r,
bool returnDelim_r =
false );
313 int stderr_fd = -1,
bool default_locale =
false,
316 start_program( argv,
Environment(), stderr_disp, stderr_fd, default_locale, root.c_str(), true );
323 #endif // ZYPP_EXTERNALPROGRAM_H
const std::string & command() const
The command we're executing.
ExternalProgram()
Start an external program by giving the arguments as an arry of char *pointers.
ExternalProgramWithSeperatePgid(const char *const *argv, Stderr_Disposition stderr_disp=Normal_Stderr, int stderr_fd=-1, bool default_locale=false, const Pathname &root="")
Bidirectional stream to external data.
bool use_pty
Set to true, if a pair of ttys is used for communication instead of a pair of pipes.
std::ostream & operator>>(std::ostream &out_r)
Redirect all command output to an ostream.
bool kill()
Kill the program.
void _initStdErr()
Close write end of the pipe (childs end).
ExternalProgram extended to offer reading programs stderr.
bool running()
Return whether program is running.
ExternalProgramWithStderr(const Arguments &argv_r, const Environment &environment_r, const Pathname &root_r)
Convenience taking just the root_r.
std::vector< std::string > Arguments
const std::string & execError() const
Some detail telling why the execution failed, if it failed.
bool stderrGetline(std::string &retval_r, bool returnDelim_r=false)
Read next complete line from stderr (nonblocking).
Execute a program and give access to its io An object of this class encapsulates the execution of an ...
ExternalProgramWithStderr(const Arguments &argv_r, bool defaultLocale_r=false, const Pathname &root_r="")
Provides API related macros.
ExternalProgramWithStderr(const Arguments &argv_r, const Environment &environment_r, bool defaultLocale_r=false, const Pathname &root_r="")
ExternalProgram extended to change the progress group ID after forking.
Stderr_Disposition
Define symbols for different policies on the handling of stderr.
std::map< std::string, std::string > Environment
For passing additional environment variables to set.
bool stderrGetUpTo(std::string &retval_r, const char delim_r, bool returnDelim_r=false)
Read data up to delim_r from stderr (nonblocking).
std::string _execError
Remember execution errors like failed fork/exec.
int close()
Wait for the progamm to complete.
std::string _command
Store the command we're executing.
ExternalProgramWithStderr(const Arguments &argv_r, const Pathname &root_r)
Convenience taking just the root_r.
static void renumber_fd(int origfd, int newfd)
origfd will be accessible as newfd and closed (unless they were equal)
void start_program(const char *const *argv, const Environment &environment, Stderr_Disposition stderr_disp=Normal_Stderr, int stderr_fd=-1, bool default_locale=false, const char *root=NULL, bool switch_pgid=false)
Helper providing pipe FDs for ExternalProgramWithStderr.
Easy-to use interface to the ZYPP dependency resolver.