All Classes Namespaces Files Functions Variables Typedefs Friends Macros Groups Pages
SDFImpl.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 _SDFIMPL_HH_
18 #define _SDFIMPL_HH_
19 
20 #include <string>
21 #include <boost/shared_ptr.hpp>
22 
23 #include "sdf/Param.hh"
24 #include "sdf/Element.hh"
25 #include "sdf/system_util.hh"
26 
28 #ifndef _WIN32
29 #pragma GCC diagnostic push
30 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
31 #endif
32 #include "sdf/Types.hh"
33 #ifndef _WIN32
34 #pragma GCC diagnostic pop
35 #endif
36 
39 namespace sdf
40 {
42 
45  typedef boost::shared_ptr<SDF> SDFPtr;
46 
49 
57  std::string findFile(const std::string &_filename,
58  bool _searchLocalPath = true,
59  bool _useCallback = false);
60 
66  void addURIPath(const std::string &_uri, const std::string &_path);
67 
73  void setFindCallback(boost::function<std::string (const std::string &)> _cb);
74 
77  {
78  public: SDF();
80  public: ~SDF();
81  public: void PrintDescription();
82  public: void PrintValues();
83  public: void PrintWiki();
84  public: void PrintDoc();
85  public: void Write(const std::string &_filename);
86  public: std::string ToString() const;
87 
89  public: void SetFromString(const std::string &_sdfData);
90 
93  public: ElementPtr Root() const;
94 
97  public: void Root(const ElementPtr _root);
98 
101  public: static std::string Version();
102 
105  public: static void Version(const std::string &_version);
106 
107 // \todo Remove this warning push/pop after sdformat 4.0
108 #ifdef _MSC_VER
109 #pragma warning(push)
110 #pragma warning(disable : 4251)
111 #endif
112 
116  public: ElementPtr root SDF_DEPRECATED(4.0);
117 
121  public: static std::string version SDF_DEPRECATED(4.0);
122 
123 #ifdef _MSC_VER
124 #pragma warning(pop)
125 #endif
126  };
128 }
129 #endif
Base SDF class.
Definition: SDFImpl.hh:76
SDF * SDFPtr
Definition: SDFImpl.hh:45
SDFORMAT_VISIBLE void setFindCallback(boost::function< std::string(const std::string &)> _cb)
Set the callback to use when SDF can't find a file.
class SDFORMAT_VISIBLE SDF
Definition: SDFImpl.hh:41
SDF Element class.
Definition: Element.hh:65
SDFORMAT_VISIBLE std::string findFile(const std::string &_filename, bool _searchLocalPath=true, bool _useCallback=false)
Find the absolute path of a file.
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:48
SDFORMAT_VISIBLE void addURIPath(const std::string &_uri, const std::string &_path)
Associate paths to a URI.
#define SDF_DEPRECATED(version)
Definition: Types.hh:37