本文整理汇总了C++中DOMError类的典型用法代码示例。如果您正苦于以下问题:C++ DOMError类的具体用法?C++ DOMError怎么用?C++ DOMError使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DOMError类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
/// 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;
}
示例2: if
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: if
// ---------------------------------------------------------------------------
// 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;
}
示例5: handleError
bool handleError(const DOMError& e)
{
std::cout << toNative(e.getMessage( )) << "\n";
return false;
}