// <org.stdplus/posix/Run.hpp>

namespace org
{
  namespace stdplus
  {
    namespace posix
    {
      class Run;
    } // namespace posix
  } // namespace stdplus
} // namespace org

Status

ALPHA This class works, but only minimally. It would be best to have it spawn threads for reading stdout and stderr, as well as implement the ability to write stdin to the child, but the author has not yet needed that level of detail.

Overview

Run and communicate with a child process.

Run is not copyable or assignable. For long object lifespan, use Run::shared_ptr

Types

typedef std::shared_ptr<Run> shared_ptr;
typedef std::shared_ptr<Run const> shared_ptr_const;

Constructors/Destructors

Run::Run(std::vector<std::string> const& commandLine);

Runs the specified command line. Shell expansion is not performed.


Run::~Run()

Closes parent-process side of the pipes. Does not wait for or kill the child process.

Methods

void Run::readStdout();

Reads stdout pipe until there is no more available.


std::string Run::getStdout() const;

Returns a std::string containing previously read output from the stdout pipe.


int wait()

Wait for the child process to exit.

Returns the child process’ exit status.