Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Attributes | List of all members
BIAS::RedirectStreams Class Reference

used to redirect stdout and stderr into files or to silence them More...

#include <Base/Debug/RedirectStreams.hh>

+ Collaboration diagram for BIAS::RedirectStreams:

Public Member Functions

void Cerr2Null ()
 call this to silence cerr More...
 
void Cout2Null ()
 call this to silence cout More...
 
RedirectStreamsoperator= (const RedirectStreams &src)
 This file defines programs for BIAS to disable some warning on WIN32 /W4 pedantic compilation mode. More...
 
void RedirectCerr (const char *file)
 direct all stderr output into a file More...
 
void RedirectCerr (const std::string &file)
 
void RedirectCout (const char *file)
 This file defines compiler pragmas for BIAS to disable some warning on WIN32 /W4 pedantic compilation mode. More...
 
void RedirectCout (const std::string &file)
 
 RedirectStreams ()
 empty useless constructor, does nothing More...
 
 RedirectStreams (const RedirectStreams &src)
 
void ResetCerr ()
 re-enables backupped standard output for cerr More...
 
void ResetCout ()
 re-enables backupped standard output for cout More...
 
virtual ~RedirectStreams ()
 

Protected Attributes

std::streambuf * ErrBuf_
 
std::ofstream ErrStr_
 
std::streambuf * OutBuf_
 
std::ofstream OutStr_
 
std::streambuf * RedirErr_
 
std::streambuf * RedirOut_
 

Detailed Description

used to redirect stdout and stderr into files or to silence them

Definition at line 38 of file RedirectStreams.hh.

Constructor & Destructor Documentation

virtual BIAS::RedirectStreams::~RedirectStreams ( )
inlinevirtual

Definition at line 41 of file RedirectStreams.hh.

BIAS::RedirectStreams::RedirectStreams ( )
inline

empty useless constructor, does nothing

Definition at line 44 of file RedirectStreams.hh.

BIAS::RedirectStreams::RedirectStreams ( const RedirectStreams src)
inline

Definition at line 47 of file RedirectStreams.hh.

Member Function Documentation

void BIAS::RedirectStreams::Cerr2Null ( )
inline

call this to silence cerr

Definition at line 81 of file RedirectStreams.hh.

References RedirectCerr().

void BIAS::RedirectStreams::Cout2Null ( )
inline

call this to silence cout

Definition at line 76 of file RedirectStreams.hh.

References RedirectCout().

RedirectStreams& BIAS::RedirectStreams::operator= ( const RedirectStreams src)
inline

This file defines programs for BIAS to disable some warning on WIN32 /W4 pedantic compilation mode.

You MUST use the Start/End files only in pairs ! Use it like this in .cpp file:

#include <BIASpragmaStart.hh>
... code ...
#include <BIASpragmaStop.hh>
Author
Jan Woetzel 08/2005

Definition at line 54 of file RedirectStreams.hh.

void BIAS::RedirectStreams::RedirectCerr ( const char *  file)
inline

direct all stderr output into a file

Definition at line 108 of file RedirectStreams.hh.

References ErrBuf_, ErrStr_, and RedirErr_.

Referenced by Cerr2Null(), and RedirectCerr().

void BIAS::RedirectStreams::RedirectCerr ( const std::string &  file)
inline

Definition at line 70 of file RedirectStreams.hh.

References RedirectCerr().

void BIAS::RedirectStreams::RedirectCout ( const char *  file)
inline

This file defines compiler pragmas for BIAS to disable some warning on WIN32 /W4 pedantic compilation mode.

You MUST use the Start/End files only in pairs ! Use it like this in .cpp file:

#include <BIASpragmaStart.hh>
... code ...
#include <BIASpragmaStop.hh>
Author
Jan Woetzel 08/2005direct all stdout output into a file

Definition at line 100 of file RedirectStreams.hh.

References OutBuf_, OutStr_, and RedirOut_.

Referenced by Cout2Null(), and RedirectCout().

void BIAS::RedirectStreams::RedirectCout ( const std::string &  file)
inline

Definition at line 67 of file RedirectStreams.hh.

References RedirectCout().

void BIAS::RedirectStreams::ResetCerr ( )
inline

re-enables backupped standard output for cerr

Definition at line 122 of file RedirectStreams.hh.

References ErrBuf_, and ErrStr_.

void BIAS::RedirectStreams::ResetCout ( )
inline

re-enables backupped standard output for cout

Definition at line 116 of file RedirectStreams.hh.

References OutBuf_, and OutStr_.

Member Data Documentation

std::streambuf * BIAS::RedirectStreams::ErrBuf_
protected

Definition at line 93 of file RedirectStreams.hh.

Referenced by RedirectCerr(), and ResetCerr().

std::ofstream BIAS::RedirectStreams::ErrStr_
protected

Definition at line 96 of file RedirectStreams.hh.

Referenced by RedirectCerr(), and ResetCerr().

std::streambuf* BIAS::RedirectStreams::OutBuf_
protected

Definition at line 93 of file RedirectStreams.hh.

Referenced by RedirectCout(), and ResetCout().

std::ofstream BIAS::RedirectStreams::OutStr_
protected

Definition at line 96 of file RedirectStreams.hh.

Referenced by RedirectCout(), and ResetCout().

std::streambuf * BIAS::RedirectStreams::RedirErr_
protected

Definition at line 93 of file RedirectStreams.hh.

Referenced by RedirectCerr().

std::streambuf * BIAS::RedirectStreams::RedirOut_
protected

Definition at line 93 of file RedirectStreams.hh.

Referenced by RedirectCout().


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