Core: Revert superfluous changes made with PR #9521
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
# include <xercesc/framework/MemBufFormatTarget.hpp>
|
||||
# include <xercesc/framework/MemBufInputSource.hpp>
|
||||
# include <xercesc/parsers/XercesDOMParser.hpp>
|
||||
# include <xercesc/sax/ErrorHandler.hpp>
|
||||
# include <xercesc/sax/SAXParseException.hpp>
|
||||
# include <sstream>
|
||||
# include <string>
|
||||
@@ -63,49 +64,49 @@ using namespace Base;
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// private classes declaration:
|
||||
// - DOMTreeErrorReporter
|
||||
// - StrX
|
||||
// - DOMPrintFilter
|
||||
// - DOMPrintErrorHandler
|
||||
// - XStr
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
DOMTreeErrorReporter::DOMTreeErrorReporter():
|
||||
fSawErrors(false) {
|
||||
}
|
||||
|
||||
void DOMTreeErrorReporter::warning(const SAXParseException&)
|
||||
{
|
||||
//
|
||||
// Ignore all warnings.
|
||||
//
|
||||
}
|
||||
|
||||
void DOMTreeErrorReporter::error(const SAXParseException& toCatch)
|
||||
class DOMTreeErrorReporter : public ErrorHandler
|
||||
{
|
||||
fSawErrors = true;
|
||||
std::cerr << "Error at file \"" << StrX(toCatch.getSystemId())
|
||||
<< "\", line " << toCatch.getLineNumber()
|
||||
<< ", column " << toCatch.getColumnNumber()
|
||||
<< "\n Message: " << StrX(toCatch.getMessage()) << std::endl;
|
||||
}
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// Constructors and Destructor
|
||||
// -----------------------------------------------------------------------
|
||||
DOMTreeErrorReporter() = default;
|
||||
|
||||
void DOMTreeErrorReporter::fatalError(const SAXParseException& toCatch)
|
||||
{
|
||||
fSawErrors = true;
|
||||
std::cerr << "Fatal Error at file \"" << StrX(toCatch.getSystemId())
|
||||
<< "\", line " << toCatch.getLineNumber()
|
||||
<< ", column " << toCatch.getColumnNumber()
|
||||
<< "\n Message: " << StrX(toCatch.getMessage()) << std::endl;
|
||||
}
|
||||
~DOMTreeErrorReporter() override = default;
|
||||
|
||||
void DOMTreeErrorReporter::resetErrors()
|
||||
{
|
||||
// No-op in this case
|
||||
}
|
||||
|
||||
inline bool DOMTreeErrorReporter::getSawErrors() const
|
||||
{
|
||||
return fSawErrors;
|
||||
}
|
||||
// -----------------------------------------------------------------------
|
||||
// Implementation of the error handler interface
|
||||
// -----------------------------------------------------------------------
|
||||
void warning(const SAXParseException& toCatch) override;
|
||||
void error(const SAXParseException& toCatch) override;
|
||||
void fatalError(const SAXParseException& toCatch) override;
|
||||
void resetErrors() override;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// 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{false};
|
||||
};
|
||||
|
||||
|
||||
class DOMPrintFilter : public DOMLSSerializerFilter
|
||||
{
|
||||
@@ -149,6 +150,14 @@ public:
|
||||
void operator=(const DOMErrorHandler&) = delete;
|
||||
|
||||
};
|
||||
|
||||
|
||||
inline bool DOMTreeErrorReporter::getSawErrors() const
|
||||
{
|
||||
return fSawErrors;
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// ParameterManager
|
||||
@@ -1824,6 +1833,42 @@ void ParameterManager::CheckDocument() const
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// DOMTreeErrorReporter
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
void DOMTreeErrorReporter::warning(const SAXParseException&)
|
||||
{
|
||||
//
|
||||
// Ignore all warnings.
|
||||
//
|
||||
}
|
||||
|
||||
void DOMTreeErrorReporter::error(const SAXParseException& toCatch)
|
||||
{
|
||||
fSawErrors = true;
|
||||
std::cerr << "Error at file \"" << StrX(toCatch.getSystemId())
|
||||
<< "\", line " << toCatch.getLineNumber()
|
||||
<< ", column " << toCatch.getColumnNumber()
|
||||
<< "\n Message: " << StrX(toCatch.getMessage()) << std::endl;
|
||||
}
|
||||
|
||||
void DOMTreeErrorReporter::fatalError(const SAXParseException& toCatch)
|
||||
{
|
||||
fSawErrors = true;
|
||||
std::cerr << "Fatal Error at file \"" << StrX(toCatch.getSystemId())
|
||||
<< "\", line " << toCatch.getLineNumber()
|
||||
<< ", column " << toCatch.getColumnNumber()
|
||||
<< "\n Message: " << StrX(toCatch.getMessage()) << std::endl;
|
||||
}
|
||||
|
||||
void DOMTreeErrorReporter::resetErrors()
|
||||
{
|
||||
// No-op in this case
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// DOMPrintFilter
|
||||
|
||||
Reference in New Issue
Block a user