XMLSubSys.h
Go to the documentation of this file.00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef XMLSubSys_h
00020 #define XMLSubSys_h
00021
00022
00023
00024
00025
00026 #ifdef _MSC_VER
00027 #include <windows_config.h>
00028 #else
00029 #include <config.h>
00030 #endif
00031
00032 #include <vector>
00033 #include <xercesc/sax2/SAX2XMLReader.hpp>
00034 #include <utils/common/UtilExceptions.h>
00035
00036
00037
00038
00039
00040 class GenericSAXHandler;
00041 class SUMOSAXHandler;
00042
00043
00044
00045
00046
00071 class XMLSubSys {
00072 public:
00087 static void init(bool enableValidation) throw(ProcessError);
00088
00089
00095 static void close() throw();
00096
00097
00109 static XERCES_CPP_NAMESPACE_QUALIFIER SAX2XMLReader * getSAXReader(SUMOSAXHandler &handler) throw();
00110
00111
00119 static void setHandler(GenericSAXHandler &handler);
00120
00121
00139 static bool runParser(GenericSAXHandler &handler,
00140 const std::string &file) throw();
00141
00142
00143 protected:
00154 static XERCES_CPP_NAMESPACE_QUALIFIER SAX2XMLReader * getSAXReader() throw();
00155
00156
00166 static void setFeature(XERCES_CPP_NAMESPACE_QUALIFIER SAX2XMLReader &reader,
00167 const std::string &feature, bool value) throw();
00168
00169
00170 private:
00172 static std::vector<XERCES_CPP_NAMESPACE_QUALIFIER SAX2XMLReader *> myReaders;
00173
00175 static unsigned int myNextFreeReader;
00176
00178 static bool myEnableValidation;
00179
00180 };
00181
00182
00183 #endif
00184
00185
00186