29#include "sdf/config.hh"
36#pragma warning(disable: 4251)
44 inline namespace SDF_VERSION_NAMESPACE {
79 std::string
findFile(
const std::string &_filename,
80 bool _searchLocalPath =
true,
81 bool _useCallback =
false);
107 const std::string &_filename,
108 bool _searchLocalPath =
true,
109 bool _useCallback =
false);
126 bool _searchLocalPath,
146 const std::string &_filename,
147 bool _searchLocalPath,
156 void addURIPath(
const std::string &_uri,
const std::string &_path);
174 public:
void Write(
const std::string &_filename);
209 const std::string &_sdfData);
244 public:
static void Version(
const std::string &_version);
272 const std::string &_filename,
const bool _quiet);
288 sdf::Errors &_errors,
const std::string &_filename);
292 private: std::unique_ptr<SDFPrivate> dataPtr;
296 private:
static std::string version;
This class contains configuration options for the libsdformat parser.
Definition ParserConfig.hh:106
This class contains configuration options for printing elements.
Definition PrintConfig.hh:33
Base SDF class.
Definition SDFImpl.hh:167
void Write(const std::string &_filename)
static ElementPtr WrapInRoot(sdf::Errors &_errors, const ElementPtr &_sdf)
wraps the SDF element into a root element with the version info.
std::string ToString(sdf::Errors &_errors, const PrintConfig &_config=PrintConfig()) const
Convert the SDF values to a string representation.
void SetOriginalVersion(const std::string &_version)
Set the spec version that this was originally parsed from.
void SetFromString(sdf::Errors &_Errors, const std::string &_sdfData)
Set SDF values from a string.
void PrintValues(sdf::Errors &_errors, const PrintConfig &_config=PrintConfig())
Output SDF's values to stdout.
static std::string Version()
Get the version.
static const std::string & EmbeddedSpec(const std::string &_filename, const bool _quiet)
Get a string representation of an SDF specification file.
void PrintValues(const PrintConfig &_config=PrintConfig())
Output SDF's values to stdout.
void SetRoot(const ElementPtr _root)
Set the root pointer.
static const std::string & EmbeddedSpec(sdf::Errors &_errors, const std::string &_filename)
Get a string representation of an SDF specification file.
static ElementPtr WrapInRoot(const ElementPtr &_sdf)
wraps the SDF element into a root element with the version info.
void Write(sdf::Errors &_errors, const std::string &_filename)
ElementPtr Root() const
Get a pointer to the root element.
void SetFilePath(const std::string &_path)
Set the path on disk.
const std::string & OriginalVersion() const
Get the spec version that this was originally parsed from.
void PrintDescription(sdf::Errors &_errors)
std::string FilePath() const
Get the path to the SDF document on disk.
void SetFromString(const std::string &_sdfData)
Set SDF values from a string.
void Clear()
Clear the data in this object.
static void Version(const std::string &_version)
Set the version string.
std::string ToString(const PrintConfig &_config=PrintConfig()) const
Convert the SDF values to a string representation.
GZ_SDFORMAT_VISIBLE void setFindCallback(std::function< std::string(const std::string &)> _cb)
Set the callback to use when SDF can't find a file.
GZ_SDFORMAT_VISIBLE std::string findFile(const std::string &_filename, bool _searchLocalPath=true, bool _useCallback=false)
Find the absolute path of a file.
GZ_SDFORMAT_VISIBLE void addURIPath(const std::string &_uri, const std::string &_path)
Associate paths to a URI.
std::shared_ptr< SDF > SDFPtr
Definition SDFImpl.hh:52
std::vector< Error > Errors
A vector of Error.
Definition Types.hh:81
std::shared_ptr< Element > ElementPtr
Definition Element.hh:55
namespace for Simulation Description Format parser
Definition Actor.hh:35
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition system_util.hh:25