libMesh
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
StreamRedirector Class Reference

This class uses RAII to control redirecting the libMesh::err stream to NULL and restoring it around some operation where we do not want to see output to the screen. More...

#include <stream_redirector.h>

Public Member Functions

 StreamRedirector ()
 Constructor; saves the original libMesh::err streambuf.
 
 ~StreamRedirector ()
 Destructor: restores the stream.
 

Private Attributes

std::streambuf * _errbuf
 

Detailed Description

This class uses RAII to control redirecting the libMesh::err stream to NULL and restoring it around some operation where we do not want to see output to the screen.

Definition at line 8 of file stream_redirector.h.

Constructor & Destructor Documentation

◆ StreamRedirector()

StreamRedirector::StreamRedirector ( )
inline

Constructor; saves the original libMesh::err streambuf.

Definition at line 15 of file stream_redirector.h.

16 : _errbuf(libMesh::err.rdbuf())
17 {
18 libMesh::err.rdbuf(nullptr);
19 }
std::streambuf * _errbuf
streambufT * rdbuf() const
Get the associated stream buffer.
OStreamProxy err

References libMesh::err, and libMesh::BasicOStreamProxy< charT, traits >::rdbuf().

◆ ~StreamRedirector()

StreamRedirector::~StreamRedirector ( )
inline

Destructor: restores the stream.

Definition at line 24 of file stream_redirector.h.

25 {
27 }

References _errbuf, libMesh::err, and libMesh::BasicOStreamProxy< charT, traits >::rdbuf().

Member Data Documentation

◆ _errbuf

std::streambuf* StreamRedirector::_errbuf
private

Definition at line 30 of file stream_redirector.h.

Referenced by ~StreamRedirector().


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