1 // 2 // Copyright (c) 2012 Artyom Beilis (Tonkikh) 3 // 4 // Distributed under the Boost Software License, Version 1.0. (See 5 // accompanying file LICENSE or copy at 6 // http://www.boost.org/LICENSE_1_0.txt) 7 // 8 #ifndef BOOST_NOWIDE_INTEGRATION_FILESYSTEM_HPP_INCLUDED 9 #define BOOST_NOWIDE_INTEGRATION_FILESYSTEM_HPP_INCLUDED 10 11 #if(defined(__GNUC__) && __GNUC__ < 5) 12 #pragma GCC diagnostic ignored "-Wunused-parameter" 13 #endif 14 #include <boost/nowide/utf8_codecvt.hpp> 15 #include <boost/filesystem/path.hpp> 16 namespace boost { 17 namespace nowide { 18 /// 19 /// Install utf8_codecvt facet into boost::filesystem::path such all char strings are interpreted as utf-8 strings 20 /// nowide_filesystem()21 inline std::locale nowide_filesystem() 22 { 23 std::locale tmp = std::locale(std::locale(), new boost::nowide::utf8_codecvt<wchar_t>()); 24 return boost::filesystem::path::imbue(tmp); 25 } 26 } // namespace nowide 27 } // namespace boost 28 29 #endif 30