/usr/include/sdformat-6.0/sdf/Root.hh is in libsdformat6-dev 6.0.0+dfsg-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | /*
* Copyright 2017 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef SDF_ROOT_HH_
#define SDF_ROOT_HH_
#include <string>
#include "sdf/Types.hh"
#include "sdf/system_util.hh"
namespace sdf
{
// Forward declarations.
class RootPrivate;
class World;
/// \brief 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.
///
/// \snippet examples/dom.cc rootUsage
///
class SDFORMAT_VISIBLE Root
{
/// \brief Default constructor
public: Root();
/// \brief Destructor
public: ~Root();
/// \brief Parse the given SDF file, and generate objects based on types
/// specified in the SDF file.
/// \param[in] _filename Name of the SDF file to parse.
/// \return Errors, which is a vector of Error objects. Each Error includes
/// an error code and message. An empty vector indicates no error.
public: Errors Load(const std::string &_filename);
/// \brief Get the SDF version specified in the parsed file or SDF
/// pointer.
/// \return SDF version string.
/// \sa void SetVersion(const std::string &_version)
public: std::string Version() const;
/// \brief Set the SDF version string.
/// \param[in] _version The new SDF version.
/// \sa std::string Version()
public: void SetVersion(const std::string &_version);
/// \brief Get the number of worlds.
/// \return Number of worlds contained in this Root object.
public: uint64_t WorldCount() const;
/// \brief Get a world based on an index.
/// \param[in] _index Index of the world. The index should be in the
/// range [0..WorldCount()).
/// \return Pointer to the world. Nullptr if the index does not exist.
/// \sa uint64_t WorldCount() const
public: const World *WorldByIndex(const uint64_t _index) const;
/// \brief Get whether a world name exists.
/// \param[in] _name Name of the world to check.
/// \return True if there exists a world with the given name.
public: bool WorldNameExists(const std::string &_name) const;
/// \brief Private data pointer
private: RootPrivate *dataPtr = nullptr;
};
}
#endif
|