Skip to content

Commit

Permalink
Add doc for the make_pattern function
Browse files Browse the repository at this point in the history
  • Loading branch information
bugdea1er committed Jan 28, 2024
1 parent 992d930 commit b1fa02a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/tmp/path.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class path {
/// @param creator wrapped mktemp-like function that returns resulting path
explicit path(std::filesystem::path path) : underlying(std::move(path)) {}

/// Creates a pattern for the mktemp-like functions.
/// If @p prefix is not empty, it is appended (as a parent) to the tempdir
static std::string make_pattern(std::string_view prefix) {
const auto parent = std::filesystem::temp_directory_path() / prefix;
std::filesystem::create_directories(parent);
Expand Down

0 comments on commit b1fa02a

Please sign in to comment.