XMLClassesRegistry.h
Go to the documentation of this file.
1 /*+-------------------------------------------------------------------------+
2  | MultiVehicle simulator (libmvsim) |
3  | |
4  | Copyright (C) 2014-2023 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 <map>
12 #include <rapidxml.hpp>
13 #include <string>
14 
15 namespace mvsim
16 {
20 {
21  private:
22  const std::string tagname_;
23  struct TXMLData
24  {
26  std::string* xml_data; // Must be kept alloc'ed during the entire life
27  // of xml_doc!!
28 
29  TXMLData() : xml_doc(nullptr), xml_data(nullptr) {}
31  {
32  if (xml_doc) delete xml_doc;
33  if (xml_data) delete xml_data;
34  }
35  };
36  std::map<std::string, TXMLData> classes_;
37 
38  public:
41  XmlClassesRegistry(const std::string& xml_class_tag)
42  : tagname_(xml_class_tag)
43  {
44  }
45 
47  const rapidxml::xml_node<char>* get(
48  const std::string& xml_node_class) const;
49 
51  void add(const std::string& input_xml_node_class);
52 
53 }; // end class
54 } // namespace mvsim
This file contains rapidxml parser and DOM implementation.
XmlClassesRegistry(const std::string &xml_class_tag)
std::map< std::string, TXMLData > classes_
const std::string tagname_
xml tag
void add(const std::string &input_xml_node_class)


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:22