Committed Scott Andrew's patches

This commit is contained in:
jez_higgins 2002-07-16 12:33:29 +00:00
parent e3a4a93044
commit 7eb1b4f295
8 changed files with 36 additions and 46 deletions

View file

@ -59,6 +59,9 @@ Package=<4>
Begin Project Dependency Begin Project Dependency
Project_Dep_Name SAXlib Project_Dep_Name SAXlib
End Project Dependency End Project Dependency
Begin Project Dependency
Project_Dep_Name Utilities
End Project Dependency
}}} }}}
############################################################################### ###############################################################################

View file

@ -64,7 +64,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "Debug" # PROP Intermediate_Dir "Debug"
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GR /GX /ZI /Od /I "..\\" /I "\work\include" /I "\work\lib" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_EXPAT" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GR /GX /ZI /Od /I "..\\" /I "\work\include" /I "\work\lib" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_XERCES" /YX /FD /GZ /c
# ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD BASE RSC /l 0x809 /d "_DEBUG"
# ADD RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe

View file

@ -445,7 +445,7 @@ namespace SAX
class XMLReader : public DEF_SAX_P<string_type> { }; class XMLReader : public DEF_SAX_P<string_type> { };
} // namespace SAX } // namespace SAX
#else #else
#error No default parser defined. #error "No default parser defined."
#endif #endif
#endif #endif

View file

@ -1,6 +1,10 @@
/* /*
* SAXlib.cpp - Pulls in the appropriate bits of the library, depending * SAXlib.cpp - Pulls in the appropriate bits of the library, depending
* on the configured options. * on the configured options. The required libraries built within this
* package are:
* SAXlib
* Utility
* - the selected parser(s)
* *
* $Id$ * $Id$
*/ */
@ -8,7 +12,6 @@
#ifdef _MSC_VER #ifdef _MSC_VER
// turn off the useless "template name is too long" warning // turn off the useless "template name is too long" warning
#pragma warning(disable: 4786) #pragma warning(disable: 4786)
#pragma comment(lib, "Utilities.lib")
#endif #endif
#define NO_DEFAULT_PARSER #define NO_DEFAULT_PARSER
@ -17,20 +20,29 @@
#ifdef USE_LIBXML2 #ifdef USE_LIBXML2
#pragma message("Pulling in libxml2") #pragma message("Pulling in libxml2")
#include <SAX/wrappers/saxlibxml2.cpp> #include <SAX/wrappers/saxlibxml2.cpp>
#ifdef _MSC_VER
// automagically link libxml2 if using VC++ // automagically link libxml2 if using VC++
#ifdef _MSC_VER
#pragma comment(lib, "libxml2.lib") #pragma comment(lib, "libxml2.lib")
#endif #endif
#endif #endif
#ifdef USE_MSXML #ifdef USE_MSXML
#ifndef _MSC_VER
#error "USE_MSXML is only valid for VisualC++ builds"
#else
#pragma message("Nothing to pull in for MSXML") #pragma message("Nothing to pull in for MSXML")
#endif
// nothing extra to pull in for MSXML // nothing extra to pull in for MSXML
#endif #endif
#ifdef USE_XERCES #ifdef USE_XERCES
// automagically link Xerces if using VC++
#ifndef _MSC_VER
#pragma message("Nothing to pull in for Xerces") #pragma message("Nothing to pull in for Xerces")
// nothing extra to pull in for Xerces #else
#pragma message("Pulling in Xerces")
#pragma comment(lib, "xerces-c_1.lib")
#endif
#endif #endif
#ifdef USE_GARDEN #ifdef USE_GARDEN

View file

@ -9,8 +9,11 @@
#include <SAX/InputSource.h> #include <SAX/InputSource.h>
#include <SAX/XMLReader.h> #include <SAX/XMLReader.h>
#include <SAX/SAXParseException.h> #include <SAX/SAXParseException.h>
#include <SAX/SAXNotRecognizedException.h>
#include <SAX/SAXNotSupportedException.h>
#include <SAX/ext/LexicalHandler.h> #include <SAX/ext/LexicalHandler.h>
#include <SAX/ext/DeclHandler.h> #include <SAX/ext/DeclHandler.h>
#include <SAX/helpers/FeatureNames.h>
#include <SAX/helpers/PropertyNames.h> #include <SAX/helpers/PropertyNames.h>
// Xerces Includes // Xerces Includes
@ -557,6 +560,7 @@ class xerces_wrapper : public SAX::basic_XMLReader<string_type>
LexicalHandlerAdaptor lexicalHandlerAdaptor_; LexicalHandlerAdaptor lexicalHandlerAdaptor_;
DeclHandlerAdaptor declHandlerAdaptor_; DeclHandlerAdaptor declHandlerAdaptor_;
string_adaptorT SA_; string_adaptorT SA_;
SAX::FeatureNames<stringT, string_adaptorT> features_;
SAX::PropertyNames<stringT, string_adaptorT> properties_; SAX::PropertyNames<stringT, string_adaptorT> properties_;
}; // class xerces_wrapper }; // class xerces_wrapper

View file

@ -65,7 +65,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GR /GX /ZI /Od /I "..\..\\" /I "\work\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GR /GX /ZI /Od /I "..\..\\" /I "\work\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "USE_XERCES" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD BASE RSC /l 0x809 /d "_DEBUG"
# ADD RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe
@ -73,7 +73,8 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib xerces-c_1.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
!ENDIF !ENDIF
@ -101,29 +102,5 @@ SOURCE=.\wrapper.cpp
SOURCE=.\SimpleHandler.h SOURCE=.\SimpleHandler.h
# End Source File # End Source File
# End Group # End Group
# Begin Group "Libs"
# PROP Default_Filter "lib"
# Begin Source File
SOURCE=\work\lib\vc6\expat.lib
# End Source File
# Begin Source File
SOURCE=..\..\lib\Utilities.lib
# End Source File
# Begin Source File
SOURCE=..\..\lib\SAX.lib
# End Source File
# Begin Source File
SOURCE="..\..\..\..\lib\vc6\xerces-c_1.lib"
# End Source File
# Begin Source File
SOURCE=..\..\..\..\lib\vc6\libxml2.lib
# End Source File
# End Group
# End Target # End Target
# End Project # End Project

View file

@ -2,6 +2,7 @@
#define SimpleHandlerH #define SimpleHandlerH
#include <string> #include <string>
#include <SAX/XMLReader.h>
#include <SAX/EntityResolver.h> #include <SAX/EntityResolver.h>
#include <SAX/DTDHandler.h> #include <SAX/DTDHandler.h>
#include <SAX/ContentHandler.h> #include <SAX/ContentHandler.h>

View file

@ -5,17 +5,6 @@
#pragma warning(disable:4786) #pragma warning(disable:4786)
#include <SAX/parsers/saxgarden.h>
#include <SAX/wrappers/saxexpat.h>
#ifdef LIBXML2
#include <SAX/wrappers/saxlibxml2.h>
#endif
#ifdef WIN32
#include <SAX/wrappers/saxmsxml2.h>
#endif
#ifdef XERCES
#include <SAX/wrappers/saxxerces.h>
#endif
#include "SimpleHandler.h" #include "SimpleHandler.h"
#include <SAX/InputSource.h> #include <SAX/InputSource.h>
@ -24,19 +13,23 @@
SAX::basic_XMLReader<std::string>* parserFactory(std::string name) SAX::basic_XMLReader<std::string>* parserFactory(std::string name)
{ {
#ifdef USE_EXPAT
if(name == "expat") if(name == "expat")
return new SAX::expat_wrapper<std::string>; return new SAX::expat_wrapper<std::string>;
#endif
#ifdef USE_GARDEN
if(name == "garden") if(name == "garden")
return new SAX::Garden; return new SAX::Garden;
#ifdef WIN32 #endif
#ifdef USE_MSXML
if(name == "msxml") if(name == "msxml")
return new SAX::msxml2_wrapper<std::string>; return new SAX::msxml2_wrapper<std::string>;
#endif #endif
#ifdef LIBXML2 #ifdef USE_LIBXML2
if(name == "libxml") if(name == "libxml")
return new SAX::libxml2_wrapper<std::string>; return new SAX::libxml2_wrapper<std::string>;
#endif #endif
#ifdef XERCES #ifdef USE_XERCES
if(name == "xerces") if(name == "xerces")
return new SAX::xerces_wrapper<std::string>; return new SAX::xerces_wrapper<std::string>;
#endif #endif