From 4dbcbc21676cc7e4a91bc7b087f27ea8b488cc64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 16 Nov 2017 21:52:54 -0800 Subject: [PATCH] Added current filepath helper.: --- include/bx/filepath.h | 1 + src/filepath.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/bx/filepath.h b/include/bx/filepath.h index a46a258..6c1134a 100644 --- a/include/bx/filepath.h +++ b/include/bx/filepath.h @@ -17,6 +17,7 @@ namespace bx { enum Enum /// { + Current, Temp, Home, diff --git a/src/filepath.cpp b/src/filepath.cpp index 0fa8e60..9b05b11 100644 --- a/src/filepath.cpp +++ b/src/filepath.cpp @@ -153,6 +153,14 @@ namespace bx return false; } + static bool getCurrentPath(char* _out, uint32_t* _inOutSize) + { + uint32_t len = *_inOutSize; + pwd(_out, len); + *_inOutSize = strLen(_out); + return true; + } + static bool getHomePath(char* _out, uint32_t* _inOutSize) { return false @@ -242,6 +250,10 @@ namespace bx switch (_dir) { + case Dir::Current: + getCurrentPath(tmp, &len); + break; + case Dir::Temp: getTempPath(tmp, &len); break;