Loading...
Searching...
No Matches
parser.hh
Go to the documentation of this file.
1/*
2 * Copyright 2012 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_HH_
18#define _SDF_PARSER_HH_
19
20#include <string>
21
22#include "sdf/SDFImpl.hh"
23#include "sdf/system_util.hh"
24
27namespace sdf
28{
31 bool init(SDFPtr _sdf);
32
35 bool initFile(const std::string &_filename, SDFPtr _sdf);
36
39 bool initFile(const std::string &_filename, ElementPtr _sdf);
40
43 bool initString(const std::string &_xmlString, SDFPtr _sdf);
44
49 sdf::SDFPtr readFile(const std::string &_filename);
50
56 sdf::SDFPtr readFile(const std::string &_filename, Errors &_errors);
57
68 bool readFile(const std::string &_filename, SDFPtr _sdf, Errors &_errors);
69
79 bool readFile(const std::string &_filename, SDFPtr _sdf);
80
88 bool readString(const std::string &_xmlString, SDFPtr _sdf, Errors &_errors);
89
96 bool readString(const std::string &_xmlString, SDFPtr _sdf);
97
105 bool readString(const std::string &_xmlString, ElementPtr _sdf,
106 Errors &_errors);
107
114 bool readString(const std::string &_xmlString, ElementPtr _sdf);
115
122 std::string getModelFilePath(const std::string &_modelDirPath);
123
125 void addNestedModel(ElementPtr _sdf, ElementPtr _includeSDF);
126
133 bool convertFile(const std::string &_filename, const std::string &_version,
134 SDFPtr _sdf);
135
142 bool convertString(const std::string &_sdfString,
143 const std::string &_version, SDFPtr _sdf);
144
153}
154#endif
namespace for Simulation Description Format parser
Definition Console.hh:36
SDFORMAT_VISIBLE void addNestedModel(ElementPtr _sdf, ElementPtr _includeSDF)
SDFORMAT_VISIBLE bool initString(const std::string &_xmlString, SDFPtr _sdf)
Initialize the SDF interface using a string.
SDFORMAT_VISIBLE bool convertFile(const std::string &_filename, const std::string &_version, SDFPtr _sdf)
Convert an SDF file to a specific SDF version.
std::shared_ptr< SDF > SDFPtr
Definition SDFImpl.hh:44
std::shared_ptr< Element > ElementPtr
Definition Element.hh:47
std::vector< Error > Errors
A vector of Error.
Definition Types.hh:69
SDFORMAT_VISIBLE sdf::SDFPtr readFile(const std::string &_filename)
Populate the SDF values from a file.
SDFORMAT_VISIBLE bool initFile(const std::string &_filename, SDFPtr _sdf)
Initialize the SDF interface using a file.
SDFORMAT_VISIBLE bool recursiveSameTypeUniqueNames(sdf::ElementPtr _elem)
Check that all sibling elements of the same type have unique names.
SDFORMAT_VISIBLE std::string getModelFilePath(const std::string &_modelDirPath)
Get the file path to the model file.
SDFORMAT_VISIBLE bool init(SDFPtr _sdf)
Init based on the installed sdf_format.xml file.
SDFORMAT_VISIBLE bool readString(const std::string &_xmlString, SDFPtr _sdf, Errors &_errors)
Populate the SDF values from a string.
SDFORMAT_VISIBLE bool convertString(const std::string &_sdfString, const std::string &_version, SDFPtr _sdf)
Convert an SDF string to a specific SDF version.
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition system_util.hh:48