scuffed-code/icu4c/source/samples/xml2txt/DOMTreeErrorReporter.hpp
Vladimir Weinstein 89628f1df9 ICU-2107 added copyright notices
X-SVN-Rev: 10722
2002-12-18 08:31:34 +00:00

52 lines
1.8 KiB
C++

/******************************************************************************
* Copyright (C) 2002, International Business Machines Corporation and
* others. All Rights Reserved.
******************************************************************************/
#include <util/XercesDefs.hpp>
#include <sax/ErrorHandler.hpp>
#include <iostream.h>
class DOMTreeErrorReporter : public ErrorHandler
{
public:
// -----------------------------------------------------------------------
// Constructors and Destructor
// -----------------------------------------------------------------------
DOMTreeErrorReporter() :
fSawErrors(false)
{
}
~DOMTreeErrorReporter()
{
}
// -----------------------------------------------------------------------
// Implementation of the error handler interface
// -----------------------------------------------------------------------
void warning(const SAXParseException& toCatch);
void error(const SAXParseException& toCatch);
void fatalError(const SAXParseException& toCatch);
void resetErrors();
// -----------------------------------------------------------------------
// Getter methods
// -----------------------------------------------------------------------
bool getSawErrors() const;
// -----------------------------------------------------------------------
// Private data members
//
// fSawErrors
// This is set if we get any errors, and is queryable via a getter
// method. Its used by the main code to suppress output if there are
// errors.
// -----------------------------------------------------------------------
bool fSawErrors;
};
inline bool DOMTreeErrorReporter::getSawErrors() const
{
return fSawErrors;
}