1 // filesystem windows_file_codecvt.hpp -----------------------------------------------//
3 // Copyright Beman Dawes 2009
5 // Distributed under the Boost Software License, Version 1.0.
6 // See http://www.boost.org/LICENSE_1_0.txt
8 // Library home page: http://www.boost.org/libs/filesystem
10 #ifndef BOOST_FILESYSTEM3_WIN_FILE_CODECVT_HPP
11 #define BOOST_FILESYSTEM3_WIN_FILE_CODECVT_HPP
13 #include <boost/filesystem/v3/config.hpp>
16 //------------------------------------------------------------------------------------//
18 // class windows_file_codecvt //
20 // Warning: partial implementation; even do_in and do_out only partially meet the //
21 // standard library specifications as the "to" buffer must hold the entire result. //
23 //------------------------------------------------------------------------------------//
25 class BOOST_FILESYSTEM_DECL windows_file_codecvt
26 : public std::codecvt
< wchar_t, char, std::mbstate_t >
29 explicit windows_file_codecvt()
30 : std::codecvt
<wchar_t, char, std::mbstate_t>() {}
33 virtual bool do_always_noconv() const throw() { return false; }
35 // seems safest to assume variable number of characters since we don't
36 // actually know what codepage is active
37 virtual int do_encoding() const throw() { return 0; }
39 virtual std::codecvt_base::result
do_in(std::mbstate_t& state
,
40 const char* from
, const char* from_end
, const char*& from_next
,
41 wchar_t* to
, wchar_t* to_end
, wchar_t*& to_next
) const;
43 virtual std::codecvt_base::result
do_out(std::mbstate_t & state
,
44 const wchar_t* from
, const wchar_t* from_end
, const wchar_t*& from_next
,
45 char* to
, char* to_end
, char*& to_next
) const;
47 virtual std::codecvt_base::result
do_unshift(std::mbstate_t&,
48 char* /*from*/, char* /*to*/, char* & /*next*/) const { return ok
; }
50 virtual int do_length(std::mbstate_t&,
51 const char* /*from*/, const char* /*from_end*/, std::size_t /*max*/) const { return 0; }
53 virtual int do_max_length() const throw () { return 0; }
56 #endif // BOOST_FILESYSTEM3_WIN_FILE_CODECVT_HPP