Gazebo Common

API Reference

6.0.0~pre2
RedirectConsoleStream Class Reference

#include <RedirectConsoleStream.hh>

Public Member Functions

 RedirectConsoleStream (const StreamSource &_source, const std::string &_destination)
 Constructor.
 
bool Active () const
 Get if the redirection is valid and enabled.
 
std::string GetString ()
 Get the contents of the redirected console output This will additionally remove any redirection.
 

Constructor & Destructor Documentation

◆ RedirectConsoleStream()

RedirectConsoleStream ( const StreamSource _source,
const std::string _destination 
)

Constructor.

Redirect a choosen stream to a temporary file that can be read back. Upon destruction, any redirection will be removed. Upon destruction, the temporary file will be removed. Access contents before destruction using GetString

Parameters
[in]_sourceConsole source to redirect (eg stdout or stderr)
[in]_destinationDestination filename

Member Function Documentation

◆ Active()

bool Active ( ) const

Get if the redirection is valid and enabled.

Returns
bool True if the redirection is valid

◆ GetString()

std::string GetString ( )

Get the contents of the redirected console output This will additionally remove any redirection.


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