Skip to content

Return std::filesystem::path from TempDir::path() and TempDir::file() #8007

Description

@mvadari

Follow-up from a review comment on #7012: #7012 (comment)

In include/xrpl/basics/FileUtilities.h, TempDir::path() and TempDir::file() both return std::string:

[[nodiscard]] std::string
path() const;

[[nodiscard]] std::string
file(std::string const& name) const;

Now that the codebase uses std::filesystem (#7012), these should probably return std::filesystem::path instead, so callers don't have to round-trip through strings. file() could likewise take a std::filesystem::path const& parameter.

This was intentionally left as-is in #7012 to keep that PR focused on the boost::filesystemstd::filesystem swap.

Work

  • Change the return types (and file()'s parameter type) to std::filesystem::path.
  • Update call sites, which are mostly in tests/benchmarks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueGreat issue for a new contributorTech DebtNon-urgent improvements

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions