parser_private.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2016 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef SDF_PARSER_PRIVATE_HH_
18 #define SDF_PARSER_PRIVATE_HH_
19 
20 #include <tinyxml.h>
21 
22 #include <string>
23 
24 #include "sdf/SDFImpl.hh"
25 #include "sdf/sdf_config.h"
26 #include "sdf/system_util.hh"
27 
30 namespace sdf
31 {
32  // Inline bracket to help doxygen filtering.
33  inline namespace SDF_VERSION_NAMESPACE {
34  //
35 
41  std::string getBestSupportedModelVersion(TiXmlElement *_modelXML,
42  std::string &_modelFileName);
43 
45  bool initDoc(TiXmlDocument *_xmlDoc, SDFPtr _sdf);
46 
48  bool initDoc(TiXmlDocument *_xmlDoc, ElementPtr _sdf);
49 
51  bool initXml(TiXmlElement *_xml, ElementPtr _sdf);
52 
54  bool readDoc(TiXmlDocument *_xmlDoc, SDFPtr _sdf, const std::string &_source,
55  bool _convert, Errors &_errors);
56 
57  bool readDoc(TiXmlDocument *_xmlDoc, ElementPtr _sdf,
58  const std::string &_source, bool _convert, Errors &_errors);
59 
65  bool readXml(TiXmlElement *_xml, ElementPtr _sdf, Errors &_errors);
66 
73  void copyChildren(ElementPtr _sdf, TiXmlElement *_xml,
74  const bool _onlyUnknown);
75  }
76 }
77 #endif
bool initDoc(TiXmlDocument *_xmlDoc, ElementPtr _sdf)
Initialize and SDF Element using a TinyXML document.
std::shared_ptr< SDF > SDFPtr
Definition: SDFImpl.hh:50
bool readDoc(TiXmlDocument *_xmlDoc, ElementPtr _sdf, const std::string &_source, bool _convert, Errors &_errors)
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:53
bool readXml(TiXmlElement *_xml, ElementPtr _sdf, Errors &_errors)
For internal use only.
void copyChildren(ElementPtr _sdf, TiXmlElement *_xml, const bool _onlyUnknown)
Copy child XML elements into the _sdf element.
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:74
namespace for Simulation Description Format parser
Definition: Actor.hh:32
std::string getBestSupportedModelVersion(TiXmlElement *_modelXML, std::string &_modelFileName)
Get the best SDF version from models supported by this sdformat.
bool initXml(TiXmlElement *_xml, ElementPtr _sdf)
For internal use only. Do not use this function.