MCPcopy Create free account
hub / github.com/boostorg/filesystem / to_internal

Method to_internal

example/mbpath.cpp:54–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52 }
53
54 mbpath_traits::internal_string_type
55 mbpath_traits::to_internal( const external_string_type & src )
56 {
57 std::size_t work_size( src.size()+1 );
58 boost::scoped_array<wchar_t> work( new wchar_t[ work_size ] );
59 std::mbstate_t state;
60 const external_string_type::value_type * from_next;
61 internal_string_type::value_type * to_next;
62 if ( cvt->in(
63 state, src.c_str(), src.c_str()+src.size(), from_next, work.get(),
64 work.get()+work_size, to_next ) != std::codecvt_base::ok )
65 boost::throw_exception<fs::basic_filesystem_error<mbpath> >(
66 fs::basic_filesystem_error<mbpath>(
67 "user::mbpath::to_internal conversion error",
68 boost::system::error_code( EINVAL, boost::system::errno_ecat ) ) );
69 *to_next = L'\0';
70 return internal_string_type( work.get() );
71 }
72
73 void mbpath_traits::imbue( const std::locale & new_loc )
74 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected