mbpath.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Boost.Filesystem mbpath.hpp ---------------------------------------------//
  2. // Copyright Beman Dawes 2005
  3. // Use, modification, and distribution is subject to the Boost Software
  4. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. // Encodes wide character paths as MBCS
  7. // See http://../doc/path.htm#mbpath for more information
  8. #include <boost/filesystem/path.hpp>
  9. #include <cwchar> // for std::mbstate_t
  10. #include <string>
  11. #include <locale>
  12. namespace user
  13. {
  14. struct mbpath_traits;
  15. typedef boost::filesystem::basic_path<std::wstring, mbpath_traits> mbpath;
  16. struct mbpath_traits
  17. {
  18. typedef std::wstring internal_string_type;
  19. typedef std::string external_string_type;
  20. static external_string_type to_external( const mbpath & ph,
  21. const internal_string_type & src );
  22. static internal_string_type to_internal( const external_string_type & src );
  23. static void imbue( const std::locale & loc );
  24. };
  25. } // namespace user
  26. namespace boost
  27. {
  28. namespace filesystem
  29. {
  30. template<> struct is_basic_path<user::mbpath>
  31. { static const bool value = true; };
  32. }
  33. }