DDS  ver. 3.6
TopoParserXML.h
Go to the documentation of this file.
1 // Copyright 2014 GSI, Inc. All rights reserved.
2 //
3 //
4 //
5 
6 #ifndef __DDS__TopologyParserXML__
7 #define __DDS__TopologyParserXML__
8 
9 // STD
10 #include <string>
11 // BOOST
12 #include <boost/property_tree/ptree.hpp>
13 
14 namespace dds
15 {
16  namespace topology_api
17  {
19  {
20  public:
26  static void parse(boost::property_tree::ptree& _pt,
27  const std::string& _filepath,
28  const std::string& _schemaFilepath,
29  std::string* _topologyName = nullptr);
30 
36  static void parse(boost::property_tree::ptree& _pt,
37  std::istream& _stream,
38  const std::string& _schemaFilepath,
39  std::string* _topologyName = nullptr);
40 
46  static bool isValid(const std::string& _filepath,
47  const std::string& _schemaFilepath,
48  std::string* _output = nullptr);
49 
55  static bool isValid(std::istream& _stream,
56  const std::string& _schemaFilepath,
57  std::string* _output = nullptr);
58 
59  private:
61  static void PrintPropertyTree(const std::string& _path, const boost::property_tree::ptree& _pt);
62  };
63  } // namespace topology_api
64 } // namespace dds
65 #endif /* defined(__DDS__TopologyParserXML__) */
static bool isValid(const std::string &_filepath, const std::string &_schemaFilepath, std::string *_output=nullptr)
Validate provided XML file against XSD using xmllint.
Miscellaneous functions and helpers are located here.
Definition: AgentConnectionManager.h:13
Definition: TopoParserXML.h:18
static void parse(boost::property_tree::ptree &_pt, const std::string &_filepath, const std::string &_schemaFilepath, std::string *_topologyName=nullptr)
Parse topology from specified XML file.