SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OptionsLoader.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A SAX-Handler for loading options
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef OptionsLoader_h
22 #define OptionsLoader_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <xercesc/sax/HandlerBase.hpp>
35 #include <xercesc/sax/AttributeList.hpp>
36 #include <xercesc/sax/SAXParseException.hpp>
37 #include <xercesc/sax/SAXException.hpp>
38 #include <string>
39 
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 class OptionsCont;
45 
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
54 class OptionsLoader : public XERCES_CPP_NAMESPACE::HandlerBase {
55 public:
58  OptionsLoader();
59 
60 
63 
64 
65 
66 
69 
74  virtual void startElement(const XMLCh* const name,
75  XERCES_CPP_NAMESPACE::AttributeList& attributes);
76 
77 
85  void characters(const XMLCh* const chars, const XERCES3_SIZE_t length);
86 
87 
92  void endElement(const XMLCh* const name);
94 
95 
96 
97 
100 
105  void warning(const XERCES_CPP_NAMESPACE::SAXParseException& exception);
106 
107 
112  void error(const XERCES_CPP_NAMESPACE::SAXParseException& exception);
113 
114 
119  void fatalError(const XERCES_CPP_NAMESPACE::SAXParseException& exception);
121 
122 
123 
125  bool errorOccured() const;
126 
127 
128 private:
137  void setValue(const std::string& key, std::string& value);
138 
139 
149  bool setSecure(const std::string& name, const std::string& value) const;
150 
151 
152 private:
154  OptionsLoader(const OptionsLoader& s);
155 
156 
159 
160 
161 private:
163  bool myError;
164 
167 
169  std::string myItem;
170 
172  std::string myValue;
173 
174 };
175 
176 
177 #endif
178 
179 /****************************************************************************/
180