diff --git a/include/nana/filesystem/filesystem_ext.hpp b/include/nana/filesystem/filesystem_ext.hpp index 2c28acad..2ff6bece 100644 --- a/include/nana/filesystem/filesystem_ext.hpp +++ b/include/nana/filesystem/filesystem_ext.hpp @@ -34,6 +34,16 @@ namespace filesystem_ext std::experimental::filesystem::path path_user(); ///< extention ? +/// workaround Boost not having path.generic_u8string() - a good point for http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0251r0.pdf +inline std::string generic_u8string(const std::experimental::filesystem::path& p) +{ + #if NANA_USING_BOOST_FILESYSTEM + return nana::to_utf8(p.generic_wstring()); + #else + return p.generic_u8string(); + #endif +} + inline bool is_directory(const std::experimental::filesystem::directory_entry& dir) noexcept { return is_directory(dir.status());