From 82944cfc2743f48e461e5612df800063af703b3d Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Wed, 7 Sep 2016 18:08:37 +0200 Subject: [PATCH] added Utilities::OS::homedir --- src/uvw/util.hpp | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/uvw/util.hpp b/src/uvw/util.hpp index abb842a4..1a3de9f3 100644 --- a/src/uvw/util.hpp +++ b/src/uvw/util.hpp @@ -333,6 +333,28 @@ struct Utilities { using CallocFuncType = void*(*)(size_t, size_t); using FreeFuncType = void(*)(void*); + struct OS { + /** + * TODO + * + * * uv_os_tmpdir + * * uv_os_get_passwd + * * uv_os_free_passwd + */ + + /** + * @brief Gets the current user's home directory. + * + * See the official + * [documentation](http://docs.libuv.org/en/v1.x/misc.html#c.uv_os_homedir) + * for further details. + * + * @return The current user's home directory. + */ + static std::string homedir() noexcept { + return details::path(&uv_os_homedir); + } + }; /** * @brief Gets the type of the stream to be used with the given descriptor. @@ -576,14 +598,4 @@ struct Utilities { }; -/** - * TODO - * - * * uv_os_homedir - * * uv_os_tmpdir - * * uv_os_get_passwd - * * uv_os_free_passwd - */ - - }