Go to the documentation of this file.
17 #ifndef SDF_PLUGIN_HH_
18 #define SDF_PLUGIN_HH_
35 #pragma warning(disable: 4251)
41 inline namespace SDF_VERSION_NAMESPACE {
73 public: std::string Name()
const;
79 public:
void SetName(
const std::string &_name);
83 public: std::string Filename()
const;
87 public:
void ClearContents();
92 public:
const std::vector<sdf::ElementPtr> &Contents()
const;
103 public:
void SetFilename(
const std::string &_filename);
134 return _out << _plugin.
ToElement()->ToString(
"");
143 std::ostringstream stream;
144 stream <<
"<sdf version='" << SDF_VERSION <<
"'>";
145 stream << std::string(std::istreambuf_iterator<char>(_in), {});
155 _plugin.
Load(sdfParsed->Root()->GetFirstElement());
void ClearContents()
Remove the contents of the plugin, this is everything that is a child element of the <plugin>.
IGNITION_SDFORMAT_VISIBLE bool init(SDFPtr _sdf)
Initialize the SDF interface from the embedded root spec file.
IGNITION_SDFORMAT_VISIBLE bool readString(const std::string &_xmlString, SDFPtr _sdf, Errors &_errors)
Populate the SDF values from a string.
namespace for Simulation Description Format parser
Definition: Actor.hh:34
std::vector< Plugin > Plugins
A vector of Plugin.
Definition: Plugin.hh:165
friend std::istream & operator>>(std::istream &_in, sdf::Plugin &_plugin)
Input stream operator for a Plugin.
Definition: Plugin.hh:140
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:106
std::unique_ptr< sdf::PluginPrivate > dataPtr
Private data pointer.
Definition: Plugin.hh:161
Errors Load(ElementPtr _sdf)
Load the plugin based on a element pointer.
Base SDF class.
Definition: SDFImpl.hh:118
#define SDFORMAT_VISIBLE
Definition: system_util.hh:25
class IGNITION_SDFORMAT_VISIBLE Element
Definition: Element.hh:50
std::shared_ptr< SDF > SDFPtr
Definition: SDFImpl.hh:52
sdf::ElementPtr ToElement() const
Create and return an SDF element filled with data from this plugin.
friend std::ostream & operator<<(std::ostream &_out, const sdf::Plugin &_plugin)
Output stream operator for a Plugin.
Definition: Plugin.hh:131
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:54