From 09722f5990e4c2aefa51fc4c38f09441f2677a9d Mon Sep 17 00:00:00 2001 From: Sylar Date: Thu, 6 Nov 2025 18:41:44 +0100 Subject: [PATCH] Added Utils::getWorkingDirPath() function --- src/ostd/FileSystem.cpp | 13 +++++++++---- src/ostd/Types.hpp | 2 +- src/ostd/Utils.hpp | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/ostd/FileSystem.cpp b/src/ostd/FileSystem.cpp index d50fe34..6c12a73 100644 --- a/src/ostd/FileSystem.cpp +++ b/src/ostd/FileSystem.cpp @@ -23,7 +23,7 @@ namespace ostd } return list; } - + std::vector Utils::listDirectory(const String& directoryPath) { std::vector list; @@ -53,7 +53,7 @@ namespace ostd } return list; } - + std::vector Utils::listDirectoryRecursive(const String& directoryPath) { std::vector list; @@ -74,5 +74,10 @@ namespace ostd #endif return home_path; } - -} \ No newline at end of file + + std::filesystem::path Utils::getWorkingDirPath(void) + { + return std::filesystem::current_path(); + } + +} diff --git a/src/ostd/Types.hpp b/src/ostd/Types.hpp index 1899d93..3d26640 100755 --- a/src/ostd/Types.hpp +++ b/src/ostd/Types.hpp @@ -48,7 +48,7 @@ namespace ostd }; typedef std::vector ByteStream; -} +} diff --git a/src/ostd/Utils.hpp b/src/ostd/Utils.hpp index 56a9635..7660533 100755 --- a/src/ostd/Utils.hpp +++ b/src/ostd/Utils.hpp @@ -196,6 +196,7 @@ namespace ostd static std::vector listDirectoriesInDirectoryRecursive(const String& directoryPath); static std::vector listDirectoryRecursive(const String& directoryPath); static ostd::String getHomeDirPath(void); + static std::filesystem::path getWorkingDirPath(void); //Implemented in static int32_t solveIntegerExpression(const String& expr);