Function ament_index_cpp::get_resource(const std::string&, const std::string&)

Function Documentation

PathWithResource ament_index_cpp::get_resource(const std::string &resource_type, const std::string &resource_name)

Get a the content and path of a resource.

Parameters:
  • resource_type[in] type of the resource

  • resource_name[in] name of the resource

Returns:

a struct with the installation prefix of the given resource if found and the contents of the resource. Returns a struct with std::nullopt path (does not throw) if resource_type or resource_name are empty.