SUMOSAXAttributesImpl_Xerces.h
Go to the documentation of this file.00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef SUMOSAXAttributesImpl_Xerces_h
00020 #define SUMOSAXAttributesImpl_Xerces_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 <string>
00033 #include <utils/common/SUMOTime.h>
00034 #include "SUMOSAXAttributes.h"
00035 #include <xercesc/sax2/Attributes.hpp>
00036 #include <map>
00037
00038
00039
00040
00041
00042 #if defined(XERCES_HAS_CPP_NAMESPACE)
00043 using namespace XERCES_CPP_NAMESPACE;
00044 #endif
00045
00046
00047
00048
00049
00056 class SUMOSAXAttributesImpl_Xerces : public SUMOSAXAttributes {
00057 public:
00064 SUMOSAXAttributesImpl_Xerces(const Attributes &attrs,
00065 const std::map<SumoXMLAttr, XMLCh*> &predefinedTags,
00066 const std::map<SumoXMLAttr, std::string> &predefinedTagsMML) throw();
00067
00068
00070 virtual ~SUMOSAXAttributesImpl_Xerces() throw();
00071
00072
00073
00074
00077
00083 bool hasAttribute(SumoXMLAttr id) const throw();
00084
00085
00101 bool getBool(SumoXMLAttr id) const throw(EmptyData, BoolFormatException);
00102
00117 bool getBoolSecure(SumoXMLAttr id, bool def) const throw(EmptyData);
00118
00119
00135 int getInt(SumoXMLAttr id) const throw(EmptyData, NumberFormatException);
00136
00154 int getIntSecure(SumoXMLAttr id, int def) const throw(EmptyData, NumberFormatException);
00155
00156
00169 std::string getString(SumoXMLAttr id) const throw(EmptyData);
00170
00183 std::string getStringSecure(SumoXMLAttr id,
00184 const std::string &def) const throw(EmptyData);
00185
00186
00202 SUMOReal getFloat(SumoXMLAttr id) const throw(EmptyData, NumberFormatException);
00203
00221 SUMOReal getFloatSecure(SumoXMLAttr id, SUMOReal def) const throw(EmptyData, NumberFormatException);
00222
00223
00227 bool hasAttribute(const std::string &id) const throw();
00228
00229
00245 SUMOReal getFloat(const std::string &id) const throw(EmptyData, NumberFormatException);
00246
00247
00257 std::string getStringSecure(const std::string &id,
00258 const std::string &def) const throw();
00259
00260
00261
00269 std::string getName(SumoXMLAttr attr) const throw();
00270
00271
00272 private:
00279 const XMLCh *getAttributeValueSecure(SumoXMLAttr id) const throw();
00280
00281
00282 private:
00284 const Attributes &myAttrs;
00285
00287 typedef std::map<SumoXMLAttr, XMLCh*> AttrMap;
00289 const AttrMap &myPredefinedTags;
00290
00292 const std::map<SumoXMLAttr, std::string> &myPredefinedTagsMML;
00293
00294
00295 private:
00297 SUMOSAXAttributesImpl_Xerces(const SUMOSAXAttributesImpl_Xerces &src);
00298
00300 SUMOSAXAttributesImpl_Xerces &operator=(const SUMOSAXAttributesImpl_Xerces &src);
00301
00302
00303 };
00304
00305
00306 #endif
00307
00308
00309