Public Member Functions | Static Public Member Functions | List of all members
sdf::SDF_VERSION_NAMESPACE::SDF Class Reference

Base SDF class. More...

#include <SDFImpl.hh>

Public Member Functions

 SDF ()
 
 ~SDF ()
 Destructor. More...
 
void Clear ()
 Clear the data in this object. More...
 
std::string FilePath () const
 Get the path to the SDF document on disk. More...
 
 GZ_DEPRECATED (13) void Root(const ElementPtr _root)
 Set the root pointer. More...
 
const std::string & OriginalVersion () const
 Get the spec version that this was originally parsed from. More...
 
void PrintDescription ()
 
void PrintDescription (sdf::Errors &_errors)
 
void PrintDoc ()
 
void PrintValues (const PrintConfig &_config=PrintConfig())
 Output SDF's values to stdout. More...
 
void PrintValues (sdf::Errors &_errors, const PrintConfig &_config=PrintConfig())
 Output SDF's values to stdout. More...
 
ElementPtr Root () const
 Get a pointer to the root element. More...
 
void SetFilePath (const std::string &_path)
 Set the path on disk. More...
 
void SetFromString (const std::string &_sdfData)
 Set SDF values from a string. More...
 
void SetFromString (sdf::Errors &_Errors, const std::string &_sdfData)
 Set SDF values from a string. More...
 
void SetOriginalVersion (const std::string &_version)
 Set the spec version that this was originally parsed from. More...
 
void SetRoot (const ElementPtr _root)
 Set the root pointer. More...
 
std::string ToString (const PrintConfig &_config=PrintConfig()) const
 Convert the SDF values to a string representation. More...
 
std::string ToString (sdf::Errors &_errors, const PrintConfig &_config=PrintConfig()) const
 Convert the SDF values to a string representation. More...
 
void Write (const std::string &_filename)
 
void Write (sdf::Errors &_errors, const std::string &_filename)
 

Static Public Member Functions

static const std::string & EmbeddedSpec (const std::string &_filename, const bool _quiet)
 Get a string representation of an SDF specification file. More...
 
static const std::string & EmbeddedSpec (sdf::Errors &_errors, const std::string &_filename)
 Get a string representation of an SDF specification file. More...
 
static std::string Version ()
 Get the version. More...
 
static void Version (const std::string &_version)
 Set the version string. More...
 
static ElementPtr WrapInRoot (const ElementPtr &_sdf)
 wraps the SDF element into a root element with the version info. More...
 
static ElementPtr WrapInRoot (sdf::Errors &_errors, const ElementPtr &_sdf)
 wraps the SDF element into a root element with the version info. More...
 

Detailed Description

Base SDF class.

Constructor & Destructor Documentation

◆ SDF()

sdf::SDF_VERSION_NAMESPACE::SDF::SDF ( )

◆ ~SDF()

sdf::SDF_VERSION_NAMESPACE::SDF::~SDF ( )

Destructor.

Member Function Documentation

◆ Clear()

void sdf::SDF_VERSION_NAMESPACE::SDF::Clear ( )

Clear the data in this object.

◆ EmbeddedSpec() [1/2]

static const std::string& sdf::SDF_VERSION_NAMESPACE::SDF::EmbeddedSpec ( const std::string &  _filename,
const bool  _quiet 
)
static

Get a string representation of an SDF specification file.

This function uses a built-in version of a .sdf file located in the sdf directory. The parser.cc code uses this function, which avoids touching the filesystem.

Most people should not use this function.

Parameters
[in]_filenameBase name of the SDF specification file to load. For example "root.sdf" or "world.sdf".
[in]_quietTrue to suppress console messages.
Returns
A string that contains the contents of the specified _filename. An empty string is returned if the _filename could not be found.

◆ EmbeddedSpec() [2/2]

static const std::string& sdf::SDF_VERSION_NAMESPACE::SDF::EmbeddedSpec ( sdf::Errors _errors,
const std::string &  _filename 
)
static

Get a string representation of an SDF specification file.

This function uses a built-in version of a .sdf file located in the sdf directory. The parser.cc code uses this function, which avoids touching the filesystem.

Most people should not use this function.

Parameters
[out]_errorsVector of errors.
[in]_filenameBase name of the SDF specification file to load. For example "root.sdf" or "world.sdf".
Returns
A string that contains the contents of the specified _filename. An empty string is returned if the _filename could not be found.

◆ FilePath()

std::string sdf::SDF_VERSION_NAMESPACE::SDF::FilePath ( ) const

Get the path to the SDF document on disk.

Returns
The full path to the SDF document.

◆ GZ_DEPRECATED()

sdf::SDF_VERSION_NAMESPACE::SDF::GZ_DEPRECATED ( 13  ) const

Set the root pointer.

Parameters
[in]_rootRoot element
Deprecated:
Use SetRoot

◆ OriginalVersion()

const std::string& sdf::SDF_VERSION_NAMESPACE::SDF::OriginalVersion ( ) const

Get the spec version that this was originally parsed from.

Returns
Spec version string.

◆ PrintDescription() [1/2]

void sdf::SDF_VERSION_NAMESPACE::SDF::PrintDescription ( )

◆ PrintDescription() [2/2]

void sdf::SDF_VERSION_NAMESPACE::SDF::PrintDescription ( sdf::Errors _errors)

◆ PrintDoc()

void sdf::SDF_VERSION_NAMESPACE::SDF::PrintDoc ( )

◆ PrintValues() [1/2]

void sdf::SDF_VERSION_NAMESPACE::SDF::PrintValues ( const PrintConfig _config = PrintConfig())

Output SDF's values to stdout.

Parameters
[in]_configConfiguration for printing the values.

◆ PrintValues() [2/2]

void sdf::SDF_VERSION_NAMESPACE::SDF::PrintValues ( sdf::Errors _errors,
const PrintConfig _config = PrintConfig() 
)

Output SDF's values to stdout.

Parameters
[out]_errorsVector of errrors.
[in]_configConfiguration for printing the values.

◆ Root()

ElementPtr sdf::SDF_VERSION_NAMESPACE::SDF::Root ( ) const

Get a pointer to the root element.

Returns
Pointer to the root element

◆ SetFilePath()

void sdf::SDF_VERSION_NAMESPACE::SDF::SetFilePath ( const std::string &  _path)

Set the path on disk.

Parameters
[in]_pathPath on disk.

◆ SetFromString() [1/2]

void sdf::SDF_VERSION_NAMESPACE::SDF::SetFromString ( const std::string &  _sdfData)

Set SDF values from a string.

Parameters
[in]sdfDataString with the values to load.

◆ SetFromString() [2/2]

void sdf::SDF_VERSION_NAMESPACE::SDF::SetFromString ( sdf::Errors _Errors,
const std::string &  _sdfData 
)

Set SDF values from a string.

Parameters
[out]_errorsVector of errors.
[in]sdfDataString with the values to load.

◆ SetOriginalVersion()

void sdf::SDF_VERSION_NAMESPACE::SDF::SetOriginalVersion ( const std::string &  _version)

Set the spec version that this was originally parsed from.

Parameters
[in]_versionSpec version string.

◆ SetRoot()

void sdf::SDF_VERSION_NAMESPACE::SDF::SetRoot ( const ElementPtr  _root)

Set the root pointer.

Parameters
[in]_rootRoot element

◆ ToString() [1/2]

std::string sdf::SDF_VERSION_NAMESPACE::SDF::ToString ( const PrintConfig _config = PrintConfig()) const

Convert the SDF values to a string representation.

Parameters
[in]_configConfiguration for printing the values.
Returns
The string representation.

◆ ToString() [2/2]

std::string sdf::SDF_VERSION_NAMESPACE::SDF::ToString ( sdf::Errors _errors,
const PrintConfig _config = PrintConfig() 
) const

Convert the SDF values to a string representation.

Parameters
[out]_errorsVector of errors.
[in]_configConfiguration for printing the values.
Returns
The string representation.

◆ Version() [1/2]

static std::string sdf::SDF_VERSION_NAMESPACE::SDF::Version ( )
static

Get the version.

Returns
The version as a string

◆ Version() [2/2]

static void sdf::SDF_VERSION_NAMESPACE::SDF::Version ( const std::string &  _version)
static

Set the version string.

Parameters
[in]_versionSDF version string.

◆ WrapInRoot() [1/2]

static ElementPtr sdf::SDF_VERSION_NAMESPACE::SDF::WrapInRoot ( const ElementPtr _sdf)
static

wraps the SDF element into a root element with the version info.

Parameters
[in]_sdfthe sdf element. Will be cloned by this function.
Returns
a wrapped clone of the SDF element

◆ WrapInRoot() [2/2]

static ElementPtr sdf::SDF_VERSION_NAMESPACE::SDF::WrapInRoot ( sdf::Errors _errors,
const ElementPtr _sdf 
)
static

wraps the SDF element into a root element with the version info.

Parameters
[out]_errorsVector of errors.
[in]_sdfthe sdf element. Will be cloned by this function.
Returns
a wrapped clone of the SDF element

◆ Write() [1/2]

void sdf::SDF_VERSION_NAMESPACE::SDF::Write ( const std::string &  _filename)

◆ Write() [2/2]

void sdf::SDF_VERSION_NAMESPACE::SDF::Write ( sdf::Errors _errors,
const std::string &  _filename 
)

The documentation for this class was generated from the following file: