summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-01-18 18:41:23 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-01-18 18:41:23 (GMT)
commitdcadffbe00c29d8a55d6d3e58cbc46caddaf1dcb (patch)
tree3d3448cf138454f0895b9290170c1384e8f02909 /Source
parentb37b661087ee2aa4bb877659ad65f2ce9cf5dba4 (diff)
downloadCMake-dcadffbe00c29d8a55d6d3e58cbc46caddaf1dcb.zip
CMake-dcadffbe00c29d8a55d6d3e58cbc46caddaf1dcb.tar.gz
CMake-dcadffbe00c29d8a55d6d3e58cbc46caddaf1dcb.tar.bz2
ENH: Add XML parser
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeLists.txt194
-rw-r--r--Source/cmXMLParser.cxx217
-rw-r--r--Source/cmXMLParser.h108
3 files changed, 423 insertions, 96 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index b202fff..076247a 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -1,56 +1,58 @@
CMAKE_MINIMUM_REQUIRED(VERSION 1.5)
SET(SRCS
-cmake.cxx
-cmakewizard.cxx
-cmMakeDepend.cxx
-cmMakefile.cxx
-cmSourceFile.cxx
-cmSystemTools.cxx
-cmDocumentation.cxx
-cmDynamicLoader.cxx
-cmCommands.cxx
-cmTarget.cxx
-cmCustomCommand.cxx
-cmCacheManager.cxx
-cmSourceGroup.cxx
-cmListFileCache.cxx
-cmListFileLexer.c
-cmGeneratedFileStream.cxx
-cmGlob.cxx
-cmGlobalGenerator.cxx
-cmGlobalUnixMakefileGenerator.cxx
-cmLocalGenerator.cxx
-cmLocalUnixMakefileGenerator.cxx
-cmLocalUnixMakefileGenerator2.cxx
-cmVariableWatch.cxx
-cmVersion.cxx
-cmake.h
-cmakewizard.h
-cmMakeDepend.h
-cmMakefile.h
-cmSourceFile.h
-cmSystemTools.h
-cmDynamicLoader.h
-cmCommands.h
-cmTarget.h
-cmCustomCommand.h
-cmCacheManager.h
-cmSourceGroup.h
-cmListFileCache.h
-cmGlobalGenerator.h
-cmGlobalUnixMakefileGenerator.h
-cmLocalGenerator.h
-cmLocalUnixMakefileGenerator.h
-cmVariableWatch.h
-cmVersion.h
-)
+ cmCacheManager.cxx
+ cmCacheManager.h
+ cmCommands.cxx
+ cmCommands.h
+ cmCustomCommand.cxx
+ cmCustomCommand.h
+ cmDocumentation.cxx
+ cmDynamicLoader.cxx
+ cmDynamicLoader.h
+ cmGeneratedFileStream.cxx
+ cmGlob.cxx
+ cmGlobalGenerator.cxx
+ cmGlobalGenerator.h
+ cmGlobalUnixMakefileGenerator.cxx
+ cmGlobalUnixMakefileGenerator.h
+ cmListFileCache.cxx
+ cmListFileCache.h
+ cmListFileLexer.c
+ cmLocalGenerator.cxx
+ cmLocalGenerator.h
+ cmLocalUnixMakefileGenerator.cxx
+ cmLocalUnixMakefileGenerator.h
+ cmLocalUnixMakefileGenerator2.cxx
+ cmMakeDepend.cxx
+ cmMakeDepend.h
+ cmMakefile.cxx
+ cmMakefile.h
+ cmSourceFile.cxx
+ cmSourceFile.h
+ cmSourceGroup.cxx
+ cmSourceGroup.h
+ cmSystemTools.cxx
+ cmSystemTools.h
+ cmTarget.cxx
+ cmTarget.h
+ cmVariableWatch.cxx
+ cmVariableWatch.h
+ cmVersion.cxx
+ cmVersion.h
+ cmXMLParser.cxx
+ cmXMLParser.h
+ cmake.cxx
+ cmake.h
+ cmakewizard.cxx
+ cmakewizard.h
+ )
# configure the .h file
CONFIGURE_FILE(
-${CMake_SOURCE_DIR}/Source/cmConfigure.cmake.h.in
-${CMake_BINARY_DIR}/Source/cmConfigure.h )
+ ${CMake_SOURCE_DIR}/Source/cmConfigure.cmake.h.in
+ ${CMake_BINARY_DIR}/Source/cmConfigure.h )
# add the include path to find the .h
INCLUDE_DIRECTORIES(${CMake_BINARY_DIR}/Source)
@@ -129,7 +131,7 @@ SET(CMTEST_SRCS ctest.cxx cmCTest.cxx
CTest/cmCTestScriptHandler.cxx
CTest/cmCTestTestHandler.cxx
CTest/cmCTestUpdateHandler.cxx
-)
+ )
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/Source/CTest)
@@ -168,7 +170,7 @@ IF(CMAKE_BUILD_WX_DIALOG)
ENDIF(CMAKE_BUILD_WX_DIALOG)
IF (NOT DART_ROOT)
-SET(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
+ SET(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
ENDIF (NOT DART_ROOT)
IF(BUILD_TESTING)
@@ -192,7 +194,7 @@ IF(BUILD_TESTING)
--build-makeprogram ${MAKEPROGRAM}
--build-project CommandLineTest
--test-command CommandLineTest)
-
+
ADD_TEST(CustomCommand ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/CustomCommand"
@@ -234,7 +236,7 @@ IF(BUILD_TESTING)
--build-project StringFileTest
--build-makeprogram ${MAKEPROGRAM}
--test-command StringFileTest)
-
+
ADD_TEST(TryCompile ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/TryCompile"
@@ -247,8 +249,8 @@ IF(BUILD_TESTING)
ADD_TEST(simple ${CMAKE_CTEST_COMMAND}
--build-and-test
- "${CMake_SOURCE_DIR}/Tests/Simple"
- "${CMake_BINARY_DIR}/Tests/Simple"
+ "${CMake_SOURCE_DIR}/Tests/Simple"
+ "${CMake_BINARY_DIR}/Tests/Simple"
--build-generator ${CMAKE_GENERATOR}
--build-project Simple
--build-makeprogram ${MAKEPROGRAM}
@@ -257,8 +259,8 @@ IF(BUILD_TESTING)
ADD_TEST(PreOrder ${CMAKE_CTEST_COMMAND}
--build-and-test
- "${CMake_SOURCE_DIR}/Tests/PreOrder"
- "${CMake_BINARY_DIR}/Tests/PreOrder"
+ "${CMake_SOURCE_DIR}/Tests/PreOrder"
+ "${CMake_BINARY_DIR}/Tests/PreOrder"
--build-generator ${CMAKE_GENERATOR}
--build-project PreOrder
--build-makeprogram ${MAKEPROGRAM}
@@ -286,7 +288,7 @@ IF(BUILD_TESTING)
--build-makeprogram ${MAKEPROGRAM}
--build-two-config
--build-options
- "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}"
+ "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}"
--test-command ${SimpleInstallInstallDir}/bin/SimpleInstall)
ADD_TEST(SimpleInstall-Stage2 ${CMAKE_CTEST_COMMAND}
--build-and-test
@@ -297,8 +299,8 @@ IF(BUILD_TESTING)
--build-makeprogram ${MAKEPROGRAM}
--build-two-config
--build-options
- "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}"
- "-DSTAGE2:BOOL=1"
+ "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}"
+ "-DSTAGE2:BOOL=1"
--test-command ${SimpleInstallInstallDir}/bin/SimpleInstallS2)
ADD_TEST(X11 ${CMAKE_CTEST_COMMAND}
@@ -393,7 +395,7 @@ IF(BUILD_TESTING)
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Testing/bin"
--test-command testing
)
-
+
ADD_TEST(wrapping ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/Wrapping"
@@ -462,14 +464,14 @@ IF(BUILD_TESTING)
--build-and-test
"${CMake_SOURCE_DIR}/Tests/Dependency"
"${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut"
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Exec"
- --build-project Dependency
+ --build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Exec"
+ --build-project Dependency
--build-generator ${CMAKE_GENERATOR}
--build-makeprogram ${MAKEPROGRAM}
- --build-options
- -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Lib
- --test-command exec
- )
+ --build-options
+ -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Lib
+ --test-command exec
+ )
ADD_TEST(dependency_wo_lib_out ${CMAKE_CTEST_COMMAND}
@@ -532,7 +534,7 @@ IF(BUILD_TESTING)
--build-options
-DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Lib
--test-command jumpExecutable
- )
+ )
ADD_TEST(JumpNoLibOut ${CMAKE_CTEST_COMMAND}
--build-and-test
@@ -544,7 +546,7 @@ IF(BUILD_TESTING)
--build-generator ${CMAKE_GENERATOR}
--build-makeprogram ${MAKEPROGRAM}
--test-command jumpExecutable
- )
+ )
ADD_TEST(linkline ${CMAKE_CTEST_COMMAND}
--build-and-test
@@ -599,33 +601,33 @@ IF(BUILD_TESTING)
--test-command test1
)
-IF (WIN32)
- ADD_TEST(SubDir ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/SubDir"
- "${CMake_BINARY_DIR}/Tests/SubDir"
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable"
- --build-generator ${CMAKE_GENERATOR}
- --build-makeprogram ${MAKEPROGRAM}
- --build-project SUBDIR
- --test-command test
- "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
- "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.obj"
- )
-ELSE (WIN32)
- ADD_TEST(SubDir ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/SubDir"
- "${CMake_BINARY_DIR}/Tests/SubDir"
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable"
- --build-generator ${CMAKE_GENERATOR}
- --build-makeprogram ${MAKEPROGRAM}
- --build-project SUBDIR
- --test-command test
- "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
- "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.o"
- )
-ENDIF (WIN32)
+ IF (WIN32)
+ ADD_TEST(SubDir ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/SubDir"
+ "${CMake_BINARY_DIR}/Tests/SubDir"
+ --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable"
+ --build-generator ${CMAKE_GENERATOR}
+ --build-makeprogram ${MAKEPROGRAM}
+ --build-project SUBDIR
+ --test-command test
+ "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
+ "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.obj"
+ )
+ ELSE (WIN32)
+ ADD_TEST(SubDir ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/SubDir"
+ "${CMake_BINARY_DIR}/Tests/SubDir"
+ --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable"
+ --build-generator ${CMAKE_GENERATOR}
+ --build-makeprogram ${MAKEPROGRAM}
+ --build-project SUBDIR
+ --test-command test
+ "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
+ "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.o"
+ )
+ ENDIF (WIN32)
IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
ADD_TEST(VSExternalInclude ${CMAKE_CTEST_COMMAND}
@@ -717,7 +719,7 @@ ENDIF (WIN32)
ENDIF(JNI_H)
ENDIF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE)
ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
-
+
IF (CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE OR WXWINDOWS_INCLUDE_DIR)
# Will be set if the wxwindows gui is on
ADD_TEST(UseWX ${CMAKE_CTEST_COMMAND}
@@ -730,12 +732,12 @@ ENDIF (WIN32)
--build-project UsewxWindows
--build-options -DCMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE:FILEPATH=${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE}
--test-command UseWX
- )
+ )
ENDIF (CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE OR WXWINDOWS_INCLUDE_DIR)
IF(UNIX)
STRING(COMPARE EQUAL "${CMAKE_INSTALL_PREFIX}" "${CMake_BINARY_DIR}/Tests/TestShellInstall/Prefix"
- PREFIX_IS_FOR_TEST)
+ PREFIX_IS_FOR_TEST)
IF(PREFIX_IS_FOR_TEST)
CONFIGURE_FILE(
${CMake_SOURCE_DIR}/Tests/TestInstall.sh.in
diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx
new file mode 100644
index 0000000..8d004a9
--- /dev/null
+++ b/Source/cmXMLParser.cxx
@@ -0,0 +1,217 @@
+/*=========================================================================
+
+ Program: CMake - Cross-Platform Makefile Generator
+ Module: $RCSfile$
+ Language: C++
+ Date: $Date$
+ Version: $Revision$
+
+ Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
+ See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*/
+#include "cmXMLParser.h"
+
+#include <cmexpat/expat.h>
+
+//----------------------------------------------------------------------------
+cmXMLParser::cmXMLParser()
+{
+ this->Parser = 0;
+ this->ParseError = 0;
+}
+
+//----------------------------------------------------------------------------
+cmXMLParser::~cmXMLParser()
+{
+ if ( this->Parser )
+ {
+ this->CleanupParser();
+ }
+}
+
+//----------------------------------------------------------------------------
+int cmXMLParser::Parse(const char* string)
+{
+ return this->InitializeParser() &&
+ this->ParseChunk(string, strlen(string)) &&
+ this->CleanupParser();
+}
+
+int cmXMLParser::ParseFile(const char* file)
+{
+ if ( !file )
+ {
+ return 0;
+ }
+
+ std::ifstream ifs(file);
+ if ( !ifs )
+ {
+ return 0;
+ }
+
+ ostringstream str;
+ str << ifs.rdbuf();
+ return this->Parse(str.str().c_str());
+}
+
+//----------------------------------------------------------------------------
+int cmXMLParser::InitializeParser()
+{
+ if ( this->Parser )
+ {
+ std::cerr << "Parser already initialized" << std::endl;
+ this->ParseError = 1;
+ return 0;
+ }
+
+ // Create the expat XML parser.
+ this->Parser = XML_ParserCreate(0);
+ XML_SetElementHandler(static_cast<XML_Parser>(this->Parser),
+ &cmXMLParserStartElement,
+ &cmXMLParserEndElement);
+ XML_SetCharacterDataHandler(static_cast<XML_Parser>(this->Parser),
+ &cmXMLParserCharacterDataHandler);
+ XML_SetUserData(static_cast<XML_Parser>(this->Parser), this);
+ this->ParseError = 0;
+ return 1;
+}
+
+//----------------------------------------------------------------------------
+int cmXMLParser::ParseChunk(const char* inputString, unsigned int length)
+{
+ if ( !this->Parser )
+ {
+ std::cerr << "Parser not initialized" << std::endl;
+ this->ParseError = 1;
+ return 0;
+ }
+ int res;
+ res = this->ParseBuffer(inputString, length);
+ if ( res == 0 )
+ {
+ this->ParseError = 1;
+ }
+ return res;
+}
+
+//----------------------------------------------------------------------------
+int cmXMLParser::CleanupParser()
+{
+ if ( !this->Parser )
+ {
+ std::cerr << "Parser not initialized" << std::endl;
+ this->ParseError = 1;
+ return 0;
+ }
+ int result = !this->ParseError;
+ if(result)
+ {
+ // Tell the expat XML parser about the end-of-input.
+ if(!XML_Parse(static_cast<XML_Parser>(this->Parser), "", 0, 1))
+ {
+ this->ReportXmlParseError();
+ result = 0;
+ }
+ }
+
+ // Clean up the parser.
+ XML_ParserFree(static_cast<XML_Parser>(this->Parser));
+ this->Parser = 0;
+
+ return result;
+}
+
+//----------------------------------------------------------------------------
+int cmXMLParser::ParseBuffer(const char* buffer, unsigned int count)
+{
+ // Pass the buffer to the expat XML parser.
+ if(!XML_Parse(static_cast<XML_Parser>(this->Parser), buffer, count, 0))
+ {
+ this->ReportXmlParseError();
+ return 0;
+ }
+ return 1;
+}
+
+//----------------------------------------------------------------------------
+int cmXMLParser::ParseBuffer(const char* buffer)
+{
+ return this->ParseBuffer(buffer, static_cast<int>(strlen(buffer)));
+}
+
+//----------------------------------------------------------------------------
+int cmXMLParser::ParsingComplete()
+{
+ // Default behavior is to parse to end of stream.
+ return 0;
+}
+
+//----------------------------------------------------------------------------
+void cmXMLParser::StartElement(const char * name,
+ const char ** /*atts*/)
+{
+ std::cout << "Start element: " << name << std::endl;
+}
+
+//----------------------------------------------------------------------------
+void cmXMLParser::EndElement(const char * name)
+{
+ std::cout << "End element: " << name << std::endl;
+}
+
+//----------------------------------------------------------------------------
+void cmXMLParser::CharacterDataHandler(const char* /*inData*/,
+ int /*inLength*/)
+{
+}
+
+//----------------------------------------------------------------------------
+int cmXMLParser::IsSpace(char c)
+{
+ return isspace(c);
+}
+
+//----------------------------------------------------------------------------
+void cmXMLParserStartElement(void* parser, const char *name,
+ const char **atts)
+{
+ // Begin element handler that is registered with the XML_Parser.
+ // This just casts the user data to a cmXMLParser and calls
+ // StartElement.
+ static_cast<cmXMLParser*>(parser)->StartElement(name, atts);
+}
+
+//----------------------------------------------------------------------------
+void cmXMLParserEndElement(void* parser, const char *name)
+{
+ // End element handler that is registered with the XML_Parser. This
+ // just casts the user data to a cmXMLParser and calls EndElement.
+ static_cast<cmXMLParser*>(parser)->EndElement(name);
+}
+
+//----------------------------------------------------------------------------
+void cmXMLParserCharacterDataHandler(void* parser, const char* data,
+ int length)
+{
+ // Character data handler that is registered with the XML_Parser.
+ // This just casts the user data to a cmXMLParser and calls
+ // CharacterDataHandler.
+ static_cast<cmXMLParser*>(parser)->CharacterDataHandler(data, length);
+}
+
+//----------------------------------------------------------------------------
+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;
+}
+
diff --git a/Source/cmXMLParser.h b/Source/cmXMLParser.h
new file mode 100644
index 0000000..cb9b9b7
--- /dev/null
+++ b/Source/cmXMLParser.h
@@ -0,0 +1,108 @@
+/*=========================================================================
+
+ Program: CMake - Cross-Platform Makefile Generator
+ Module: $RCSfile$
+ Language: C++
+ Date: $Date$
+ Version: $Revision$
+
+ Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
+ See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*/
+#ifndef cmXMLParser_h
+#define cmXMLParser_h
+
+#include "cmStandardIncludes.h"
+
+extern "C"
+{
+ void cmXMLParserStartElement(void*, const char*, const char**);
+ void cmXMLParserEndElement(void*, const char*);
+ void cmXMLParserCharacterDataHandler(void*, const char*, int);
+}
+
+/** \class cmXMLParser
+ * \brief Helper class for performing XML parsing
+ *
+ * Superclass for all XML parsers.
+ */
+class cmXMLParser
+{
+public:
+ cmXMLParser();
+ virtual ~cmXMLParser();
+
+ //! Parse given XML string
+ virtual int Parse(const char* string);
+
+ //! Parse given XML file
+ virtual int ParseFile(const char* file);
+
+ /**
+ * When parsing fragments of XML or streaming XML, use the following three
+ * methods. InitializeParser method initialize parser but does not perform
+ * any actual parsing. ParseChunk parses framgent of XML. This has to match
+ * to what was already parsed. CleanupParser finishes parsing. If there were
+ * errors, CleanupParser will report them.
+ */
+ virtual int InitializeParser();
+ virtual int ParseChunk(const char* inputString, unsigned int length);
+ virtual int CleanupParser();
+
+protected:
+ //! This variable is true if there was a parse error while parsing in chunks.
+ int ParseError;
+
+ //1 Expat parser structure. Exists only during call to Parse().
+ void* Parser;
+
+ /**
+ * Called before each block of input is read from the stream to check if
+ * parsing is complete. Can be replaced by subclasses to change the
+ * terminating condition for parsing. Parsing always stops when the end of
+ * file is reached in the stream.
+ */
+
+ virtual int ParsingComplete();
+
+ /**
+ * Called when a new element is opened in the XML source. Should be replaced
+ * by subclasses to handle each element.
+ * name = Name of new element.
+ * atts = Null-terminated array of attribute name/value pairs. Even
+ * indices are attribute names, and odd indices are values.
+ */
+ virtual void StartElement(const char* name, const char** atts);
+
+ //! Called at the end of an element in the XML source opened when StartElement
+ // was called.
+ virtual void EndElement(const char* name);
+
+ //! Called when there is character data to handle.
+ virtual void CharacterDataHandler(const char* data, int length);
+
+ //! Called by Parse to report an XML syntax error.
+ virtual void ReportXmlParseError();
+
+ //! Utility for convenience of subclasses. Wraps isspace C library
+ // routine.
+ static int IsSpace(char c);
+
+ //! Send the given buffer to the XML parser.
+ virtual int ParseBuffer(const char* buffer, unsigned int count);
+
+ //! Send the given c-style string to the XML parser.
+ int ParseBuffer(const char* buffer);
+
+ //! Callbacks for the expat
+ friend void cmXMLParserStartElement(void*, const char*, const char**);
+ friend void cmXMLParserEndElement(void*, const char*);
+ friend void cmXMLParserCharacterDataHandler(void*, const char*, int);
+};
+
+#endif