XMLClassesRegistry.h
Go to the documentation of this file.
1 /*+-------------------------------------------------------------------------+
2  | MultiVehicle simulator (libmvsim) |
3  | |
4  | Copyright (C) 2014-2020 Jose Luis Blanco Claraco |
5  | Copyright (C) 2017 Borys Tymchenko (Odessa Polytechnic University) |
6  | Distributed under 3-clause BSD License |
7  | See COPYING |
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(nullptr), xml_data(nullptr) {}
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 } // namespace mvsim
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 Fri May 7 2021 03:05:51