Skip to content

Commit

Permalink
port: 9 to 10 (#397)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll authored Jan 5, 2024
2 parents 0ba4d29 + 0104942 commit 27c5be1
Show file tree
Hide file tree
Showing 39 changed files with 2,020 additions and 2,021 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

Build | Status
-- | --
Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-fuel-tools/branch/main/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-fuel-tools/branch/main)
Ubuntu Focal | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_fuel-tools-ci-main-focal-amd64)](https://build.osrfoundation.org/job/ignition_fuel-tools-ci-main-focal-amd64)
Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_fuel-tools-ci-main-homebrew-amd64)](https://build.osrfoundation.org/job/ignition_fuel-tools-ci-main-homebrew-amd64)
Windows | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ign_fuel-tools-ci-win)](https://build.osrfoundation.org/job/ign_fuel-tools-ci-win/)
Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-fuel-tools/tree/main/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-fuel-tools/tree/main)
Ubuntu Jammy | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_fuel_tools-ci-main-jammy-amd64)](https://build.osrfoundation.org/job/gz_fuel_tools-ci-main-jammy-amd64)
Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_fuel_tools-ci-main-homebrew-amd64)](https://build.osrfoundation.org/job/gz_fuel_tools-ci-main-homebrew-amd64)
Windows | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_fuel_tools-main-win)](https://build.osrfoundation.org/job/gz_fuel_tools-main-win/)

Gazebo Fuel Tools is composed by a client library and command line tools for
interacting with Gazebo Fuel servers.
Expand Down
155 changes: 76 additions & 79 deletions include/gz/fuel_tools/ClientConfig.hh
Original file line number Diff line number Diff line change
Expand Up @@ -34,89 +34,86 @@
#pragma warning(disable: 4251)
#endif

namespace gz
namespace gz::fuel_tools
{
namespace fuel_tools
/// \brief Forward Declaration
class ClientConfigPrivate;

/// \brief High level interface to Gazebo Fuel.
///
class GZ_FUEL_TOOLS_VISIBLE ClientConfig
{
/// \brief Forward Declaration
class ClientConfigPrivate;

/// \brief High level interface to Gazebo Fuel.
///
class GZ_FUEL_TOOLS_VISIBLE ClientConfig
{
/// \brief Constructor.
public: ClientConfig();

/// \brief Copy constructor.
/// \param[in] _copy ClientConfig to copy.
public: ClientConfig(const ClientConfig &_copy);

/// \brief Assignment operator overload.
/// \param[in] _copy ClientConfig to copy.
public: ClientConfig &operator=(const ClientConfig &_copy);

/// \brief Destructor.
public: ~ClientConfig();

/// \brief Clear the client config. This will set all values to empty
/// strings, except the user agent which will be set to its default
/// value.
public: void Clear();

/// \brief Set the user agent name.
/// \param[in] _agent User agent name.
public: void SetUserAgent(const std::string &_agent);

/// \brief Get the user agent name.
/// \return Name of the user agent.
public: const std::string &UserAgent() const;

/// \brief Load a YAML configuration file.
/// \param[in] _file Config file to load.
/// \return True if the configuration was loaded correctly.
/// \sa ConfigPath
public: bool LoadConfig(const std::string &_file);

/// \brief Get the location of the configuration file.
/// \return Path to the configuration file, which is set via
/// LoadConfig. The default return value is an empty string.
/// \sa LoadConfig
public: std::string ConfigPath() const;

/// \brief List of servers the client will connect to.
/// \return The list of servers.
public: std::vector<ServerConfig> Servers() const;

/// \brief List of servers the client will connect to.
/// \return The list of servers.
public: std::vector<ServerConfig> & MutableServers() const;

/// \brief Add a server to the list.
/// \param[in] _srv The server config.
public: void AddServer(const ServerConfig &_srv);

/// \brief Where are models and stuff stored locally?
/// \return The location where assets are stored locally.
public: std::string CacheLocation() const;

/// \brief Set where models and stuff are saved.
/// \param[in] _path path on disk where models are saved.
public: void SetCacheLocation(const std::string &_path);

/// \brief Returns all the client information as a string.
/// \param[in] _prefix Optional prefix for every line of the string.
/// \return Client information string
public: std::string AsString(const std::string &_prefix = "") const;

/// \brief PIMPL
private: std::unique_ptr<ClientConfigPrivate> dataPtr;
};
}
}
/// \brief Constructor.
public: ClientConfig();

/// \brief Copy constructor.
/// \param[in] _copy ClientConfig to copy.
public: ClientConfig(const ClientConfig &_copy);

/// \brief Assignment operator overload.
/// \param[in] _copy ClientConfig to copy.
public: ClientConfig &operator=(const ClientConfig &_copy);

/// \brief Destructor.
public: ~ClientConfig();

/// \brief Clear the client config. This will set all values to empty
/// strings, except the user agent which will be set to its default
/// value.
public: void Clear();

/// \brief Set the user agent name.
/// \param[in] _agent User agent name.
public: void SetUserAgent(const std::string &_agent);

/// \brief Get the user agent name.
/// \return Name of the user agent.
public: const std::string &UserAgent() const;

/// \brief Load a YAML configuration file.
/// \param[in] _file Config file to load.
/// \return True if the configuration was loaded correctly.
/// \sa ConfigPath
public: bool LoadConfig(const std::string &_file);

/// \brief Get the location of the configuration file.
/// \return Path to the configuration file, which is set via
/// LoadConfig. The default return value is an empty string.
/// \sa LoadConfig
public: std::string ConfigPath() const;

/// \brief List of servers the client will connect to.
/// \return The list of servers.
public: std::vector<ServerConfig> Servers() const;

/// \brief List of servers the client will connect to.
/// \return The list of servers.
public: std::vector<ServerConfig> & MutableServers() const;

/// \brief Add a server to the list.
/// \param[in] _srv The server config.
public: void AddServer(const ServerConfig &_srv);

/// \brief Where are models and stuff stored locally?
/// \return The location where assets are stored locally.
public: std::string CacheLocation() const;

/// \brief Set where models and stuff are saved.
/// \param[in] _path path on disk where models are saved.
public: void SetCacheLocation(const std::string &_path);

/// \brief Returns all the client information as a string.
/// \param[in] _prefix Optional prefix for every line of the string.
/// \return Client information string
public: std::string AsString(const std::string &_prefix = "") const;

/// \brief PIMPL
private: std::unique_ptr<ClientConfigPrivate> dataPtr;
};
} // namespace gz::fuel_tools

#ifdef _MSC_VER
#pragma warning(pop)
#endif

#endif
#endif // GZ_FUEL_TOOLS_CLIENTCONFIG_HH_
157 changes: 77 additions & 80 deletions include/gz/fuel_tools/CollectionIdentifier.hh
Original file line number Diff line number Diff line change
Expand Up @@ -30,90 +30,87 @@
#pragma warning(disable: 4251)
#endif

namespace gz
namespace gz::fuel_tools
{
namespace fuel_tools
/// \brief Forward Declaration
class CollectionIdentifierPrivate;
class ServerConfig;

/// \brief Defines how to identify a collection
class GZ_FUEL_TOOLS_VISIBLE CollectionIdentifier
{
/// \brief Forward Declaration
class CollectionIdentifierPrivate;
class ServerConfig;

/// \brief Defines how to identify a collection
class GZ_FUEL_TOOLS_VISIBLE CollectionIdentifier
{
/// \brief Constructor.
public: CollectionIdentifier();

/// \brief Copy Constructor.
/// \param[in] _orig CollectionIdentifier to copy.
public: CollectionIdentifier(const CollectionIdentifier &_orig);

/// \brief Destructor.
public: ~CollectionIdentifier();

/// \brief Assignment operator
/// \param[in] _orig CollectionIdentifier to copy.
/// \return Reference to this object.
public: CollectionIdentifier
&operator=(const CollectionIdentifier &_orig);

/// \brief Equality operator.
/// \param[in] _rhs CollectionIdentifier to compare.
/// \return True if the CollectionIdentifier names are equal.
public: bool operator==(const CollectionIdentifier &_rhs) const;

/// \brief Returns the collection name
/// \return Collection name.
public: std::string Name() const;

/// \brief Set the name of the collection.
/// \param[in] _name The name to set.
/// \return True if successful.
public: bool SetName(const std::string &_name);

/// \brief Returns owner to attribute collection to.
/// \return Owner name.
public: std::string Owner() const;

/// \brief Set the owner of the collection
/// \param[in] _name The name to set. Must be ascii and pass [-_a-z0-9]+
/// \return true if successful
public: bool SetOwner(const std::string &_name);

/// \brief Returns server information to retrieve collection from.
/// \return Server information.
public: ServerConfig &Server() const;

/// \brief Set the server from which this collection comes.
/// \param[in] _server The server to retrieve the collection from.
/// \return True if successful.
public: bool SetServer(const ServerConfig &_server);

/// \brief Returns a unique name for the collection.
/// \remarks this is Server/Owner/Name.
/// \return Unique collection name.
public: std::string UniqueName() const;

/// \brief Returns all the collection information as a string. Convenient
/// for debugging.
/// \param[in] _prefix Optional prefix for every line of the string.
/// \return Collection information string
public: std::string AsString(const std::string &_prefix = "") const;

/// \brief Returns all the available collection information as a string
/// using colors for better human parsing.
/// \param[in] _prefix Optional prefix for every line of the string.
/// \return Collection information string
public: std::string AsPrettyString(const std::string &_prefix = "") const;

/// \brief PIMPL
private: std::unique_ptr<CollectionIdentifierPrivate> dataPtr;
};
}
}
/// \brief Constructor.
public: CollectionIdentifier();

/// \brief Copy Constructor.
/// \param[in] _orig CollectionIdentifier to copy.
public: CollectionIdentifier(const CollectionIdentifier &_orig);

/// \brief Destructor.
public: ~CollectionIdentifier();

/// \brief Assignment operator
/// \param[in] _orig CollectionIdentifier to copy.
/// \return Reference to this object.
public: CollectionIdentifier
&operator=(const CollectionIdentifier &_orig);

/// \brief Equality operator.
/// \param[in] _rhs CollectionIdentifier to compare.
/// \return True if the CollectionIdentifier names are equal.
public: bool operator==(const CollectionIdentifier &_rhs) const;

/// \brief Returns the collection name
/// \return Collection name.
public: std::string Name() const;

/// \brief Set the name of the collection.
/// \param[in] _name The name to set.
/// \return True if successful.
public: bool SetName(const std::string &_name);

/// \brief Returns owner to attribute collection to.
/// \return Owner name.
public: std::string Owner() const;

/// \brief Set the owner of the collection
/// \param[in] _name The name to set. Must be ascii and pass [-_a-z0-9]+
/// \return true if successful
public: bool SetOwner(const std::string &_name);

/// \brief Returns server information to retrieve collection from.
/// \return Server information.
public: ServerConfig &Server() const;

/// \brief Set the server from which this collection comes.
/// \param[in] _server The server to retrieve the collection from.
/// \return True if successful.
public: bool SetServer(const ServerConfig &_server);

/// \brief Returns a unique name for the collection.
/// \remarks this is Server/Owner/Name.
/// \return Unique collection name.
public: std::string UniqueName() const;

/// \brief Returns all the collection information as a string. Convenient
/// for debugging.
/// \param[in] _prefix Optional prefix for every line of the string.
/// \return Collection information string
public: std::string AsString(const std::string &_prefix = "") const;

/// \brief Returns all the available collection information as a string
/// using colors for better human parsing.
/// \param[in] _prefix Optional prefix for every line of the string.
/// \return Collection information string
public: std::string AsPrettyString(const std::string &_prefix = "") const;

/// \brief PIMPL
private: std::unique_ptr<CollectionIdentifierPrivate> dataPtr;
};
} // namespace gz::fuel_tools

#ifdef _MSC_VER
#pragma warning(pop)
#endif

#endif
#endif // GZ_FUEL_TOOLS_COLLECTIONIDENTIFIER_HH_
Loading

0 comments on commit 27c5be1

Please sign in to comment.