Loading...
Searching...
No Matches
obLogBuf Class Reference

`#include <openbabel/oberror.h>`

Inheritance diagram for obLogBuf:
[legend]

## Public Member Functions

virtual | ~obLogBuf ()

## Protected Member Functions

int | sync ()

## Detailed Description

A minimal streambuf derivative to wrap calls to cerr into calls to OBMessageHandler as needed.

This class is used for internal use, via OBMessageHandler::StartErrorWrap() To use this class, use the global OBMessageHandler object `obErrorLog:`

obErrorLog.StartErrorWrap(); // All output to cerr will become OBErrors
cerr << " This is error 1" << endl; // flush output, create a new error
cerr << " Error 2" << endl;
cerr << " Error 3: Done with output wrapping." << endl;
obErrorLog.StopErrorWrap(); // return to default behavior
OpenBabel::obErrorLog
OBMessageHandler obErrorLog
Global OBMessageHandler error handler.
Definition oberror.h:187

## Constructor & Destructor Documentation

## ~obLogBuf()

virtual ~obLogBuf | ( |  | ) |

inline virtual

Close the output buffer, flush, and call OBMessageHandler::ThrowError().

## Member Function Documentation

## sync()

int sync | ( |  | ) |

inline protected

Call OBMessageHandler::ThrowError() and flush the buffer.

Referenced by ~obLogBuf().

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

- oberror.h