14 #include <mrpt/version.h> 15 #if MRPT_VERSION<0x199 16 #include <mrpt/utils/utils_defs.h> 18 #include <mrpt/core/format.h> 19 #include <mrpt/core/bits_math.h> 24 using namespace mvsim;
28 const std::string& xml_node_vehicle_class)
const 30 map<string, TXMLData>::const_iterator it =
31 m_classes.find(xml_node_vehicle_class);
32 if (it == m_classes.end())
35 return it->second.xml_doc->first_node();
41 std::string* xml_node_vehicle_class =
42 new std::string(input_xml_node_vehicle_class);
44 char* input_str =
const_cast<char*
>(xml_node_vehicle_class->c_str());
48 xml->
parse<0>(input_str);
56 "[XmlClassesRegistry] Missing XML node <%s>",
61 if (!att_name || !att_name->
value())
64 "[VehicleClassesRegistry] Missing mandatory attribute " 65 "'name' in node <%s>",
68 const string sClassName = att_name->
value();
78 static_cast<long>(std::count(input_str, e.
where<
char>(),
'\n') + 1);
80 throw std::runtime_error(
82 "[XmlClassesRegistry] XML parse error (Line %u): %s",
83 static_cast<unsigned>(line), e.
what()));
85 catch (std::exception&)
xml_node< Ch > * first_node(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
rapidxml::xml_document * xml_doc
virtual const char * what() const
xml_attribute< Ch > * first_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
const rapidxml::xml_node< char > * get(const std::string &xml_node_class) const
void add(const std::string &input_xml_node_class)