 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
26 #include <xercesc/sax2/Attributes.hpp>
27 #include <xercesc/sax2/DefaultHandler.hpp>
43 const std::map<int, XMLCh*>& predefinedTags,
44 const std::map<int, std::string>& predefinedTagsMML,
45 const std::string& objectType) :
48 myPredefinedTags(predefinedTags),
49 myPredefinedTagsMML(predefinedTagsMML) { }
62 return myAttrs.getIndex((*i).second) >= 0;
93 if (XERCES_CPP_NAMESPACE::XMLString::stringLen(utf16) == 0) {
112 return myAttrs.getValue((*i).second);
120 XERCES_CPP_NAMESPACE::XMLString::release(&t);
128 bool result =
myAttrs.getIndex(t) >= 0;
129 XERCES_CPP_NAMESPACE::XMLString::release(&t);
136 const std::string& str)
const {
138 const XMLCh* v =
myAttrs.getValue(t);
139 XERCES_CPP_NAMESPACE::XMLString::release(&t);
209 if (pos.size() != 2 && pos.size() != 3) {
214 if (pos.size() == 2) {
229 if (st.
size() != 4) {
236 return Boundary(xmin, ymin, xmax, ymax);
251 for (
int i = 0; i < (int)
myAttrs.getLength(); ++i) {
258 std::vector<std::string>
260 std::vector<std::string> result;
261 for (
int i = 0; i < (int)
myAttrs.getLength(); ++i) {
270 std::map<std::string, std::string> attrs;
271 for (
int i = 0; i < (int)
myAttrs.getLength(); ++i) {
bool hasAttribute(int id) const
Returns the information whether the named (by its enum-value) attribute is within the current list.
FringeType
algorithms for computing right of way
std::string getName(int attr) const
Converts the given attribute id into a man readable string.
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
long long int getLong(int id) const
Returns the long-value of the named (by its enum-value) attribute.
bool hasNext()
returns the information whether further substrings exist
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
RGBColor getColor() const
Returns the value of the named attribute.
const XERCES_CPP_NAMESPACE::Attributes & myAttrs
The encapsulated attributes.
static StringBijection< RightOfWay > RightOfWayValues
righ of way algorithms
const std::string & getObjectType() const
return the objecttype to which these attributes belong
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
SUMOSAXAttributes * clone() const
return a new deep-copy attributes object
virtual ~SUMOSAXAttributesImpl_Xerces()
Destructor.
PositionVector getShape(int attr) const
Tries to read given attribute assuming it is a PositionVector.
std::string getStringSecure(int id, const std::string &def) const
Returns the string-value of the named (by its enum-value) attribute.
SumoXMLEdgeFunc getEdgeFunc(bool &ok) const
Returns the value of the named attribute.
SumoXMLNodeType getNodeType(bool &ok) const
Returns the value of the named attribute.
Encapsulated Xerces-SAX-attributes.
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
T get(const std::string &str) const
bool getBool(int id) const
Returns the bool-value of the named (by its enum-value) attribute.
double getFloat(int id) const
Returns the double-value of the named (by its enum-value) attribute.
static RGBColor parseColor(std::string coldef)
Parses a color information.
Boundary getBoundary(int attr) const
Tries to read given attribute assuming it is a Boundary.
A class that stores a 2D geometrical boundary.
SUMOSAXAttributesImpl_Xerces(const XERCES_CPP_NAMESPACE::Attributes &attrs, const std::map< int, XMLCh * > &predefinedTags, const std::map< int, std::string > &predefinedTagsMML, const std::string &objectType)
Constructor.
A point in 2D or 3D with translation and scaling methods.
FringeType getFringeType(bool &ok) const
returns fringe type
int size() const
returns the number of existing substrings
const std::map< int, std::string > & myPredefinedTagsMML
Map of attribute ids to their (readable) string-representation.
static std::string transcode(const XMLCh *const data)
converts a 0-terminated XMLCh* array (usually UTF-16, stemming from Xerces) into std::string in UTF-8
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
const AttrMap & myPredefinedTags
Map of attribute ids to their xerces-representation.
std::string transcode(const XMLCh *const qname)
RightOfWay
algorithms for computing right of way
static StringBijection< SumoXMLEdgeFunc > EdgeFunctions
edge functions
int getInt(int id) const
Returns the int-value of the named (by its enum-value) attribute.
const XMLCh * getAttributeValueSecure(int id) const
Returns Xerces-value of the named attribute.
How to compute right of way.
static StringBijection< FringeType > FringeTypeValues
fringe types
std::vector< std::string > getAttributeNames() const
Retrieves all attribute names.
RightOfWay getRightOfWay(bool &ok) const
returns rightOfWay method
static long long int toLong(const std::string &sData)
converts a string into the long value described by it by calling the char-type converter,...
std::string getString(int id) const
Returns the string-value of the named (by its enum-value) attribute.
Encapsulated SAX-Attributes.
void serialize(std::ostream &os) const
Prints all attribute names and values into the given stream.
static StringBijection< SumoXMLNodeType > NodeTypes
node types