From 1375095e7ceb792bb34a2d8b7eca10118b20db3f Mon Sep 17 00:00:00 2001 From: bugdea1er Date: Tue, 12 Mar 2024 16:44:55 +0300 Subject: [PATCH] Add documentation for the new functions --- include/tmp/directory | 6 ++++++ include/tmp/file | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/include/tmp/directory b/include/tmp/directory index 33add60..ab4c0f4 100644 --- a/include/tmp/directory +++ b/include/tmp/directory @@ -45,6 +45,12 @@ public: /// @throws std::filesystem::filesystem_error if cannot create a directory explicit directory(std::string_view prefix = ""); + /// Creates a unique temporary copy recursively from the given path + /// + /// @param path A path to make a temporary copy from + /// @param prefix A prefix to be used in the temporary directory path + /// @return The new temporary directory + /// @throws std::filesystem::filesystem_error if the given path is not a directory static directory copy(const std::filesystem::path& path, std::string_view prefix = ""); /// Concatenates this directory path with a given @p source diff --git a/include/tmp/file b/include/tmp/file index 8c98985..69bf76b 100644 --- a/include/tmp/file +++ b/include/tmp/file @@ -59,6 +59,12 @@ public: /// @throws std::filesystem::filesystem_error if cannot create a file static file text(std::string_view prefix = ""); + /// Creates a unique temporary copy from the given path + /// + /// @param path A path to make a temporary copy from + /// @param prefix A prefix to be used in the temporary directory path + /// @return The new temporary file + /// @throws std::filesystem::filesystem_error if the given path is not a regular file static file copy(const std::filesystem::path& path, std::string_view prefix = ""); /// Streams the contents of this file