diff --git a/build.nr b/build.nr index 861c126..7dbf0f4 100644 --- a/build.nr +++ b/build.nr @@ -1 +1 @@ -1854 +1855 diff --git a/src/ostd/FileSystem.cpp b/src/ostd/FileSystem.cpp index ccd5628..d50fe34 100644 --- a/src/ostd/FileSystem.cpp +++ b/src/ostd/FileSystem.cpp @@ -61,5 +61,18 @@ namespace ostd list.push_back(file.path()); return list; } + + ostd::String Utils::getHomeDirPath(void) + { + ostd::String home_path = ""; +#ifdef WINDOWS_OS + home_path = ostd::String(getenv("HOMEDRIVE")) + "\\" + ostd::String(getenv("HOMEPATH")); +#elif defined(LINUX_OS) + home_path = ostd::String(getenv("HOME")); +#else + home_path = "NULL"; +#endif + return home_path; + } } \ No newline at end of file diff --git a/src/ostd/Utils.hpp b/src/ostd/Utils.hpp index 9d95225..16634df 100755 --- a/src/ostd/Utils.hpp +++ b/src/ostd/Utils.hpp @@ -157,6 +157,7 @@ namespace ostd static std::vector listFilesInDirectoryRecursive(const String& directoryPath); static std::vector listDirectoriesInDirectoryRecursive(const String& directoryPath); static std::vector listDirectoryRecursive(const String& directoryPath); + static ostd::String getHomeDirPath(void); //Implemented in static int32_t solveIntegerExpression(const String& expr);