当前位置: 首页>>代码示例>>C++>>正文


C++ DOMError::getSeverity方法代码示例

本文整理汇总了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;
}
开发者ID:kanbang,项目名称:Colt,代码行数:25,代码来源:Normalizer.cpp

示例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;
}
开发者ID:CRTandKDU,项目名称:NCloseCompiler,代码行数:16,代码来源:CouchRunServer.cpp

示例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;
 }
开发者ID:arjunroy,项目名称:modelnet-core,代码行数:16,代码来源:xml.cpp

示例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;
}
开发者ID:ernstae,项目名称:sysforpopkinetics,代码行数:17,代码来源:DOMPrintErrorHandler.cpp

示例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;
 }
开发者ID:GSoC-2012-Nascetti,项目名称:SAR_PlugIn,代码行数:12,代码来源:xmlreaderSAR.cpp

示例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;
}
开发者ID:QEver,项目名称:vosproj,代码行数:26,代码来源:XInclude.cpp

示例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;
 }
开发者ID:vvolkl,项目名称:DD4hep,代码行数:25,代码来源:DocumentHandler.cpp

示例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;
 }
开发者ID:kanbang,项目名称:Colt,代码行数:8,代码来源:MemoryMonitor.cpp


注:本文中的DOMError::getSeverity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。