XMLClassesRegistry.h
Go to the documentation of this file.
1 /*+-------------------------------------------------------------------------+
2  | MultiVehicle simulator (libmvsim) |
3  | |
4  | Copyright (C) 2014 Jose Luis Blanco Claraco (University of Almeria) |
5  | Copyright (C) 2017 Borys Tymchenko (Odessa Polytechnic University) |
6  | Distributed under GNU General Public License version 3 |
7  | See <http://www.gnu.org/licenses/> |
8  +-------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <rapidxml.hpp>
12 
13 #include <map>
14 #include <string>
15 
16 namespace mvsim
17 {
21 {
22  private:
23  const std::string m_tagname;
24  struct TXMLData
25  {
27  std::string* xml_data; // Must be kept alloc'ed during the entire life
28  // of xml_doc!!
29 
30  TXMLData() : xml_doc(NULL), xml_data(NULL) {}
32  {
33  if (xml_doc) delete xml_doc;
34  if (xml_data) delete xml_data;
35  }
36  };
37  std::map<std::string, TXMLData> m_classes;
38 
39  public:
42  XmlClassesRegistry(const std::string& xml_class_tag)
43  : m_tagname(xml_class_tag)
44  {
45  }
46 
48  const rapidxml::xml_node<char>* get(
49  const std::string& xml_node_class) const;
50 
52  void add(const std::string& input_xml_node_class);
53 
54 }; // end class
55 }
This file contains rapidxml parser and DOM implementation.
std::map< std::string, TXMLData > m_classes
XmlClassesRegistry(const std::string &xml_class_tag)
void add(const std::string &input_xml_node_class)
const std::string m_tagname
xml tag


mvsim
Author(s):
autogenerated on Thu Jun 6 2019 19:36:40