Skip to content

Feature Request: Support for std::filesystem::path in ament_index_cpp #92

@Ryanf55

Description

@Ryanf55

Feature Request

Could this library support the use std::filesystem::path? You can also use std::optional to represent optional parameters without a raw pointer. Both are C++17 only.

Example

AMENT_INDEX_CPP_PUBLIC
bool
get_resource(
  const std::string & resource_type,
  const std::string & resource_name,
  std::string & content,
  std::optional<std::filesystem::path> prefix_path = std::nullopt);
  
  
AMENT_INDEX_CPP_PUBLIC
std::filesystem::path
get_package_prefix(const std::string & package_name);

For functions that return std::string currently such as get_package_prefix, an alternative signature may be needed to preserve ABI such as:

AMENT_INDEX_CPP_PUBLIC
void
get_package_prefix(const std::string & package_name, std::filesystem::path & path);

Then, the library could go through a deprecation process of returning std::string paths and slowly convert the ecosystem to using std::filesystem for path-like types.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions