diff options
Diffstat (limited to 'common/strutils.h')
-rw-r--r-- | common/strutils.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/common/strutils.h b/common/strutils.h index 2bfd15fc..db9b07c6 100644 --- a/common/strutils.h +++ b/common/strutils.h @@ -1,12 +1,14 @@ #ifndef AL_STRUTILS_H #define AL_STRUTILS_H -#ifdef _WIN32 +#include <string> + +#include "aloptional.h" +#ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include <windows.h> -#include <string> inline std::string wstr_to_utf8(const WCHAR *wstr) { @@ -40,4 +42,13 @@ inline std::wstring utf8_to_wstr(const char *str) #endif +namespace al { + +al::optional<std::string> getenv(const char *envname); +#ifdef _WIN32 +al::optional<std::wstring> getenv(const WCHAR *envname); +#endif + +} // namespace al + #endif /* AL_STRUTILS_H */ |