本文整理汇总了C++中DOMError::getSeverity方法的典型用法代码示例。如果您正苦于以下问题:C++ DOMError::getSeverity方法的具体用法?C++ DOMError::getSeverity怎么用?C++ DOMError::getSeverity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOMError
的用法示例。
在下文中一共展示了DOMError::getSeverity方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleError
bool Normalizer::handleError(const DOMError& domError)
{
// Display whatever error message passed from the serializer
if (domError.getSeverity() == DOMError::DOM_SEVERITY_WARNING)
XERCES_STD_QUALIFIER cerr << "\nWarning Message: ";
else if (domError.getSeverity() == DOMError::DOM_SEVERITY_ERROR)
XERCES_STD_QUALIFIER cerr << "\nError Message: ";
else
XERCES_STD_QUALIFIER cerr << "\nFatal Message: ";
char *msg = XMLString::transcode(domError.getMessage());
XERCES_STD_QUALIFIER cerr<< msg <<XERCES_STD_QUALIFIER endl;
XMLString::release(&msg);
XERCES_STD_QUALIFIER cerr << "Related data ";
msg = XMLString::transcode(((DOMNode*)domError.getRelatedData())->getNodeName());
XERCES_STD_QUALIFIER cerr << msg <<XERCES_STD_QUALIFIER endl;
XMLString::release(&msg);
// continue serialization if possible.
return true;
}
示例2: handleError
bool DOMCountErrorHandler::handleError(const DOMError& domError){
fSawErrors = true;
if (domError.getSeverity() == DOMError::DOM_SEVERITY_WARNING)
XERCES_STD_QUALIFIER cerr << "\nWarning at file ";
else if (domError.getSeverity() == DOMError::DOM_SEVERITY_ERROR)
XERCES_STD_QUALIFIER cerr << "\nError at file ";
else
XERCES_STD_QUALIFIER cerr << "\nFatal Error at file ";
XERCES_STD_QUALIFIER cerr << StrX(domError.getLocation()->getURI())
<< ", line " << domError.getLocation()->getLineNumber()
<< ", char " << domError.getLocation()->getColumnNumber()
<< "\n Message: " << StrX(domError.getMessage()) << XERCES_STD_QUALIFIER endl;
return true;
}
示例3: handleError
bool handleError(const DOMError& domError) {
sawErrors = true;
if (domError.getSeverity() == DOMError::DOM_SEVERITY_WARNING)
cerr << "\nWarning at file ";
else if (domError.getSeverity() == DOMError::DOM_SEVERITY_ERROR)
cerr << "\nError at file ";
else
cerr << "\nFatal Error at file ";
cerr << StrX(domError.getLocation()->getURI())
<< ", line " << domError.getLocation()->getLineNumber()
<< ", char " << domError.getLocation()->getColumnNumber()
<< "\n Message: " << StrX(domError.getMessage()) << endl;
return false;
}
示例4: handleError
bool DOMPrintErrorHandler::handleError(const DOMError &domError)
{
// Display whatever error message passed from the serializer
if (domError.getSeverity() == DOMError::DOM_SEVERITY_WARNING)
XERCES_STD_QUALIFIER cerr << "\nWarning Message: ";
else if (domError.getSeverity() == DOMError::DOM_SEVERITY_ERROR)
XERCES_STD_QUALIFIER cerr << "\nError Message: ";
else
XERCES_STD_QUALIFIER cerr << "\nFatal Message: ";
char *msg = XMLString::transcode(domError.getMessage());
XERCES_STD_QUALIFIER cerr<< msg <<XERCES_STD_QUALIFIER endl;
XMLString::release(&msg);
// Instructs the serializer to continue serialization if possible.
return true;
}
示例5: handleError
bool handleError(const DOMError& domError)
{
if (mpLogger != NULL)
{
mpLogger->logError(domError);
}
if (domError.getSeverity() == DOMError::DOM_SEVERITY_FATAL_ERROR)
{
return false;
}
return true;
}
示例6: handleError
// ---------------------------------------------------------------------------
// XIncludeHandlers: Overrides of the DOM ErrorHandler interface
// ---------------------------------------------------------------------------
bool XIncludeErrorHandler::handleError(const DOMError& domError)
{
bool continueParsing = true;
if (domError.getSeverity() == DOMError::DOM_SEVERITY_WARNING)
XERCES_STD_QUALIFIER cerr << "\nWarning at file ";
else if (domError.getSeverity() == DOMError::DOM_SEVERITY_ERROR)
{
XERCES_STD_QUALIFIER cerr << "\nError at file ";
fSawErrors = true;
}
else {
XERCES_STD_QUALIFIER cerr << "\nFatal Error at file ";
continueParsing = false;
fSawErrors = true;
}
XERCES_STD_QUALIFIER cerr << StrX(domError.getLocation()->getURI())
<< ", line " << domError.getLocation()->getLineNumber()
<< ", char " << domError.getLocation()->getColumnNumber()
<< "\n Message: " << StrX(domError.getMessage()) << XERCES_STD_QUALIFIER endl;
return continueParsing;
}
示例7: handleError
/// Dom Error handler callback
bool DocumentErrorHandler::handleError(const DOMError& domError) {
string err = "DOM UNKNOWN: ";
switch (domError.getSeverity()) {
case DOMError::DOM_SEVERITY_WARNING:
err = "DOM WARNING: ";
break;
case DOMError::DOM_SEVERITY_ERROR:
err = "DOM ERROR: ";
break;
case DOMError::DOM_SEVERITY_FATAL_ERROR:
err = "DOM FATAL: ";
break;
default:
return false;
}
printout(FATAL,"DocumentErrorHandler", "+++ %s %s: %s", err.c_str(),
_toString(domError.getType()).c_str(),_toString(domError.getMessage()).c_str());
DOMLocator* loc = domError.getLocation();
if (loc) {
printout(FATAL,"DocumentErrorHandler","+++ Location: Line:%d Column: %d",
int(loc->getLineNumber()),int(loc->getColumnNumber()));
}
return false;
}
示例8: handleError
bool handleError(const DOMError &error)
{
char *message = 0;
XERCES_STD_QUALIFIER cerr << "Error occurred in DOMBuilder! Message: " <<
(message = XMLString::transcode(error.getMessage())) << " of severity " << error.getSeverity() << "." << XERCES_STD_QUALIFIER endl;
XMLString::release(&message);
return true;
}