From 956c471c9f93c5b98350202b3c6434d0a6b924d3 Mon Sep 17 00:00:00 2001 From: GamesTrap Date: Sun, 17 Nov 2024 14:39:22 +0100 Subject: [PATCH] Utils Added documentation for SafeSystem() 11/17/2024 | 24w46b1 --- TRAP/src/Utils/SafeSystem.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/TRAP/src/Utils/SafeSystem.h b/TRAP/src/Utils/SafeSystem.h index 2f7bf89a4..141c4b867 100644 --- a/TRAP/src/Utils/SafeSystem.h +++ b/TRAP/src/Utils/SafeSystem.h @@ -8,7 +8,14 @@ namespace TRAP::Utils { - //TODO Document + /// @brief Safe replacement for system()/shell calls without invoking a command processor (ENV33-C). + /// @param program Executable to run. Example: "explorer", "xdg-open". + /// @param args Arguments for the executable. + /// @param waitForChild Whether to wait for the called executable to exit or not. + /// @return If waitForChild is false then void on successful invocation, + /// if waitForChild is true then void on successful invocation and normal exit of the executable. + /// String containing an error description otherwise. + /// @threadsafe [[nodiscard]] TRAP::Expected SafeSystem(const std::string& program, const std::vector& args, bool waitForChild); }