Open Babel: obLogBuf Class Reference

Public Member Functions | Protected Member Functions

# obLogBuf Class Reference

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

`#include <openbabel/oberror.h>`

List of all members.

## 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

## Constructor & Destructor Documentation

virtual ~obLogBuf | ( | ) | `[inline, virtual]`

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

## Member Function Documentation

int sync | ( | ) | `[inline, protected]`

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

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

- oberror.h

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines