|
| Root () |
| Default constructor.
|
| ~Root () |
| Destructor.
|
Errors | Load (const std::string &_filename) |
| Parse the given SDF file, and generate objects based on types specified in the SDF file.
|
void | SetVersion (const std::string &_version) |
| Set the SDF version string.
|
std::string | Version () const |
| Get the SDF version specified in the parsed file or SDF pointer.
|
const World * | WorldByIndex (const uint64_t _index) const |
| Get a world based on an index.
|
uint64_t | WorldCount () const |
| Get the number of worlds.
|
bool | WorldNameExists (const std::string &_name) const |
| Get whether a world name exists.
|
Root class that acts as an entry point to the SDF document model.
Usage
In this example, a root object is loaded from a file specified in the first command line argument to a program.
if (errors.empty())
{
std::cerr << "Valid SDF file.\n";
return 0;
}
else
{
std::cerr << "Errors encountered: \n";
for (auto const &e : errors)
{
std::cout << e << std::endl;
}
}