Dobby 3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
StdStreamPipe Class Reference

Utility object that creates a pipe that can be used to capture stdout/ stderr. More...

#include <StdStreamPipe.h>

Public Member Functions

 StdStreamPipe (bool logPipeContents)
 Creates a new pipe that can be used to capture std streams.
 
int writeFd () const
 
std::string getPipeContents () const
 Gets the contents of the pipe as a string.
 

Private Attributes

int mReadFd
 
int mWriteFd
 
bool mLogPipe
 

Detailed Description

Utility object that creates a pipe that can be used to capture stdout/ stderr.

Constructor & Destructor Documentation

◆ StdStreamPipe()

StdStreamPipe::StdStreamPipe ( bool  logPipeContents)

Creates a new pipe that can be used to capture std streams.

Parameters
logPipeContentsIf true, then log the contents of the pipe when destructed (useful for capturing stderr)

Member Function Documentation

◆ getPipeContents()

std::string StdStreamPipe::getPipeContents ( ) const

Gets the contents of the pipe as a string.

Warning
This is not thread-safe as will seek the pipe.

The documentation for this class was generated from the following files: