ome-common 5.2.0-m2

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Private Attributes | List of all members
ome::common::xml::ErrorReporter Class Reference

Xerces error handler reporting errors to an ostream. More...

`#include <ome/common/xml/ErrorReporter.h>`

Inheritance diagram for ome::common::xml::ErrorReporter:
[legend]
Collaboration diagram for ome::common::xml::ErrorReporter:
[legend]

## Public Member Functions
| ErrorReporter (std::ostream &stream=std::cerr)
| Construct an ErrorReporter. More...
| ~ErrorReporter ()
| The destructor.
void | warning (const xercesc::SAXParseException &toCatch)
| Log a warning. More...
void | error (const xercesc::SAXParseException &toCatch)
| Log an error. More...
void | fatalError (const xercesc::SAXParseException &toCatch)
| Log a fatal error. More...
void | resetErrors ()
| Reset error status. More...
| operator bool () const
| Has an error been encountered? More...

## Private Attributes
std::ostream & | stream
| The output stream to use.
bool | saw_error
| Has an error been encountered?

## Detailed Description

Xerces error handler reporting errors to an ostream.

Encountered Xerces xercesc::SAXParseException exceptions are logged to the specified ostream. Xerces exceptions don't derive from any of the standard exception classes, and don't use standard strings, making them difficult to catch and process. If an error is encountered, this class will evaluate to true.

## Constructor & Destructor Documentation

ome::common::xml::ErrorReporter::ErrorReporter | ( | std::ostream & | stream = `std::cerr` | ) |

Construct an ErrorReporter.

Parameters

  stream | the stream to output exception details to.

## Member Function Documentation

void ome::common::xml::ErrorReporter::error | ( | const xercesc::SAXParseException & | toCatch | ) |

Log an error.

Parameters

  toCatch | the exception to log.

References saw_error, and stream.

void ome::common::xml::ErrorReporter::fatalError | ( | const xercesc::SAXParseException & | toCatch | ) |

Log a fatal error.

Parameters

  toCatch | the exception to log.

References saw_error.

ome::common::xml::ErrorReporter::operator bool | ( |  | ) | const
| inline

Has an error been encountered?

Returns
  true if an error has been encountered, otherwise false.

References saw_error.

void ome::common::xml::ErrorReporter::resetErrors | ( |  | ) |

Reset error status.

Forget any errors which have been previously encountered. The class will subsequently evaluate to true.

References saw_error.

void ome::common::xml::ErrorReporter::warning | ( | const xercesc::SAXParseException & | toCatch | ) |

Log a warning.

Parameters

  toCatch | the exception to log.

References stream.

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

- ome/common/xml/ErrorReporter.h
- ome/common/xml/ErrorReporter.cpp