From a3f8f515fd353efdd5e594b2dae9f4190b0aca1d Mon Sep 17 00:00:00 2001
From: Joscha Schmiedt <schmiedt@uni-bremen.de>
Date: Thu, 22 Aug 2024 21:49:50 +0200
Subject: [PATCH] NEW: Add Win32 way for retreiving home folder

---
 include/caosdb/utility.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/caosdb/utility.h b/include/caosdb/utility.h
index 13e3dfe..3a170d1 100644
--- a/include/caosdb/utility.h
+++ b/include/caosdb/utility.h
@@ -172,8 +172,12 @@ auto load_json_file(const path &json_file) -> JsonValue;
 auto base64_encode(const std::string &plain) -> std::string;
 
 inline auto get_home_directory() -> const path {
+#if defined(_WIN32)
+  const auto *const home = getenv("USERPROFILE");
+#else
   const auto *const home = getenv("HOME");
-  // TODO(tf) Add windowsy way of determining the home directory
+#endif
+  
   return home;
 }
 
-- 
GitLab