[Cmake-commits] [cmake-commits] king committed cmXMLParser.cxx 1.8 1.9 cmXMLParser.h 1.4 1.5
cmake-commits at cmake.org
cmake-commits at cmake.org
Tue Feb 24 15:43:39 EST 2009
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv6613/Source
Modified Files:
cmXMLParser.cxx cmXMLParser.h
Log Message:
ENH: Allow cmXMLParser subclasses to report errors
This tells cmXMLParser to report error messages through virtual method
cmXMLParser::ReportError so that subclasses can override the default
report.
Index: cmXMLParser.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmXMLParser.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -C 2 -d -r1.8 -r1.9
*** cmXMLParser.cxx 31 Jul 2007 01:38:50 -0000 1.8
--- cmXMLParser.cxx 24 Feb 2009 20:43:37 -0000 1.9
***************
*** 212,220 ****
void cmXMLParser::ReportXmlParseError()
{
! std::cerr << "Error parsing XML in stream at line "
! << XML_GetCurrentLineNumber(static_cast<XML_Parser>(this->Parser))
! << ": "
! << XML_ErrorString(XML_GetErrorCode(
! static_cast<XML_Parser>(this->Parser))) << std::endl;
}
--- 212,225 ----
void cmXMLParser::ReportXmlParseError()
{
! XML_Parser* parser = static_cast<XML_Parser*>(this->Parser);
! this->ReportError(XML_GetCurrentLineNumber(parser),
! XML_GetCurrentColumnNumber(parser),
! XML_ErrorString(XML_GetErrorCode(parser)));
}
+ //----------------------------------------------------------------------------
+ void cmXMLParser::ReportError(int line, int, const char* msg)
+ {
+ std::cerr << "Error parsing XML in stream at line "
+ << line << ": " << msg << std::endl;
+ }
Index: cmXMLParser.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmXMLParser.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C 2 -d -r1.4 -r1.5
*** cmXMLParser.h 26 Jul 2007 18:36:06 -0000 1.4
--- cmXMLParser.h 24 Feb 2009 20:43:37 -0000 1.5
***************
*** 92,95 ****
--- 92,98 ----
virtual void ReportXmlParseError();
+ /** Called by ReportXmlParseError with basic error info. */
+ virtual void ReportError(int line, int column, const char* msg);
+
//! Utility for convenience of subclasses. Wraps isspace C library
// routine.
More information about the Cmake-commits
mailing list