Rumba C++ SDK
maquina::RedirectStd Class Referenceabstract

#include <RedirectStd.h>

Public Types

enum  FileDescriptor { FileDescriptor::out, FileDescriptor::err }
 

Public Member Functions

 RedirectStd (FileDescriptor fd)
 Once the object created, the stream is redirected. More...
 
virtual ~RedirectStd ()
 
FileDescriptor file_descriptor () const
 
void restore ()
 Must be called in the derived object's destructor. More...
 
virtual void on_data (const gsl::span< char > &buffer)=0
 The callback when data have been read on the stream. UTF-8 character are integral. More...
 

Detailed Description

Redirect stdout or stderr to intercept the stream but continue to send it to the original output. The data stream is supposed to be UTF-8 text

Member Enumeration Documentation

◆ FileDescriptor

Enumerator
out 

Redirect stdout.

err 

Redirect stderr.

Constructor & Destructor Documentation

◆ RedirectStd()

maquina::RedirectStd::RedirectStd ( FileDescriptor  fd)

Once the object created, the stream is redirected.

Parameters
fdThe file to redirect

◆ ~RedirectStd()

virtual maquina::RedirectStd::~RedirectStd ( )
inlinevirtual

Member Function Documentation

◆ file_descriptor()

FileDescriptor maquina::RedirectStd::file_descriptor ( ) const
inline

◆ on_data()

virtual void maquina::RedirectStd::on_data ( const gsl::span< char > &  buffer)
pure virtual

The callback when data have been read on the stream. UTF-8 character are integral.

The callback is called in a dedicated thread

◆ restore()

void maquina::RedirectStd::restore ( )

Must be called in the derived object's destructor.


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