PUMA Library Reference Manual
Loading...
Searching...
No Matches
Puma::PipedCmd Class Reference

#include <Puma/PipedCmd.h>

Description

Executes a shell command and gives access to the output of the command.

Public Member Functions

 PipedCmd ()
 Constructor.
 
int exec (const char *cmd)
 Execute the given shell command.
 
const std::string & getOutput () const
 Get the output produced by the executed command.
 

Constructor & Destructor Documentation

◆ PipedCmd()

Puma::PipedCmd::PipedCmd ( )
inline

Constructor.

Member Function Documentation

◆ exec()

int Puma::PipedCmd::exec ( const char * cmd)

Execute the given shell command.

Parameters
cmdThe shell command.
Returns
The return code of the command.

◆ getOutput()

const std::string & Puma::PipedCmd::getOutput ( ) const
inline

Get the output produced by the executed command.

Returns
A reference to a string with the recored output.