]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/filesystem/src/windows_file_codecvt.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / filesystem / src / windows_file_codecvt.hpp
1 // filesystem windows_file_codecvt.hpp -----------------------------------------------//
2
3 // Copyright Beman Dawes 2009
4
5 // Distributed under the Boost Software License, Version 1.0.
6 // See http://www.boost.org/LICENSE_1_0.txt
7
8 // Library home page: http://www.boost.org/libs/filesystem
9
10 #ifndef BOOST_FILESYSTEM3_WIN_FILE_CODECVT_HPP
11 #define BOOST_FILESYSTEM3_WIN_FILE_CODECVT_HPP
12
13 #include <boost/filesystem/config.hpp>
14 #include <locale>
15
16 //------------------------------------------------------------------------------------//
17 // //
18 // class windows_file_codecvt //
19 // //
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. //
22 // //
23 //------------------------------------------------------------------------------------//
24
25 class BOOST_FILESYSTEM_DECL windows_file_codecvt
26 : public std::codecvt< wchar_t, char, std::mbstate_t >
27 {
28 public:
29 explicit windows_file_codecvt(std::size_t refs = 0)
30 : std::codecvt<wchar_t, char, std::mbstate_t>(refs) {}
31 protected:
32
33 virtual bool do_always_noconv() const throw() { return false; }
34
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; }
38
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;
42
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;
46
47 virtual std::codecvt_base::result do_unshift(std::mbstate_t&,
48 char* /*from*/, char* /*to*/, char* & /*next*/) const { return ok; }
49
50 virtual int do_length(std::mbstate_t&,
51 const char* /*from*/, const char* /*from_end*/, std::size_t /*max*/) const { return 0; }
52
53 virtual int do_max_length() const throw () { return 0; }
54 };
55
56 #endif // BOOST_FILESYSTEM3_WIN_FILE_CODECVT_HPP