]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/winapi/character_code_conversion.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / winapi / character_code_conversion.hpp
1 /*
2 * Copyright 2016 Andrey Semashev
3 *
4 * Distributed under the Boost Software License, Version 1.0.
5 * See http://www.boost.org/LICENSE_1_0.txt
6 */
7
8 #ifndef BOOST_WINAPI_CHARACTER_CODE_CONVERSION_HPP_INCLUDED_
9 #define BOOST_WINAPI_CHARACTER_CODE_CONVERSION_HPP_INCLUDED_
10
11 #include <boost/winapi/basic_types.hpp>
12
13 #ifdef BOOST_HAS_PRAGMA_ONCE
14 #pragma once
15 #endif
16
17 #if !defined( BOOST_USE_WINDOWS_H )
18 extern "C" {
19
20 BOOST_SYMBOL_IMPORT int WINAPI
21 MultiByteToWideChar(
22 boost::winapi::UINT_ CodePage,
23 boost::winapi::DWORD_ dwFlags,
24 boost::winapi::LPCSTR_ lpMultiByteStr,
25 int cbMultiByte,
26 boost::winapi::LPWSTR_ lpWideCharStr,
27 int cchWideChar);
28
29 BOOST_SYMBOL_IMPORT int WINAPI
30 WideCharToMultiByte(
31 boost::winapi::UINT_ CodePage,
32 boost::winapi::DWORD_ dwFlags,
33 boost::winapi::LPCWSTR_ lpWideCharStr,
34 int cchWideChar,
35 boost::winapi::LPSTR_ lpMultiByteStr,
36 int cbMultiByte,
37 boost::winapi::LPCSTR_ lpDefaultChar,
38 boost::winapi::LPBOOL_ lpUsedDefaultChar);
39
40 } // extern "C"
41 #endif // #if !defined( BOOST_USE_WINDOWS_H )
42
43 namespace boost {
44 namespace winapi {
45
46 #if defined( BOOST_USE_WINDOWS_H )
47
48 const UINT_ CP_ACP_ = CP_ACP;
49 const UINT_ CP_OEMCP_ = CP_OEMCP;
50 const UINT_ CP_MACCP_ = CP_MACCP;
51 const UINT_ CP_THREAD_ACP_ = CP_THREAD_ACP;
52 const UINT_ CP_SYMBOL_ = CP_SYMBOL;
53 const UINT_ CP_UTF7_ = CP_UTF7;
54 const UINT_ CP_UTF8_ = CP_UTF8;
55
56 const DWORD_ MB_PRECOMPOSED_ = MB_PRECOMPOSED;
57 const DWORD_ MB_COMPOSITE_ = MB_COMPOSITE;
58 const DWORD_ MB_USEGLYPHCHARS_ = MB_USEGLYPHCHARS;
59 const DWORD_ MB_ERR_INVALID_CHARS_ = MB_ERR_INVALID_CHARS;
60
61 const DWORD_ WC_COMPOSITECHECK_ = WC_COMPOSITECHECK;
62 const DWORD_ WC_DISCARDNS_ = WC_DISCARDNS;
63 const DWORD_ WC_SEPCHARS_ = WC_SEPCHARS;
64 const DWORD_ WC_DEFAULTCHAR_ = WC_DEFAULTCHAR;
65 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K
66 const DWORD_ WC_NO_BEST_FIT_CHARS_ = WC_NO_BEST_FIT_CHARS;
67 #endif
68
69 #else // defined( BOOST_USE_WINDOWS_H )
70
71 const UINT_ CP_ACP_ = 0u;
72 const UINT_ CP_OEMCP_ = 1u;
73 const UINT_ CP_MACCP_ = 2u;
74 const UINT_ CP_THREAD_ACP_ = 3u;
75 const UINT_ CP_SYMBOL_ = 42u;
76 const UINT_ CP_UTF7_ = 65000u;
77 const UINT_ CP_UTF8_ = 65001u;
78
79 const DWORD_ MB_PRECOMPOSED_ = 0x00000001;
80 const DWORD_ MB_COMPOSITE_ = 0x00000002;
81 const DWORD_ MB_USEGLYPHCHARS_ = 0x00000004;
82 const DWORD_ MB_ERR_INVALID_CHARS_ = 0x00000008;
83
84 const DWORD_ WC_COMPOSITECHECK_ = 0x00000200;
85 const DWORD_ WC_DISCARDNS_ = 0x00000010;
86 const DWORD_ WC_SEPCHARS_ = 0x00000020;
87 const DWORD_ WC_DEFAULTCHAR_ = 0x00000040;
88 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K
89 const DWORD_ WC_NO_BEST_FIT_CHARS_ = 0x00000400;
90 #endif
91
92 #endif // defined( BOOST_USE_WINDOWS_H )
93
94 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
95 // This constant is not present in MinGW
96 const DWORD_ WC_ERR_INVALID_CHARS_ = 0x00000080;
97 #endif
98
99 using ::MultiByteToWideChar;
100 using ::WideCharToMultiByte;
101
102 } // namespace winapi
103 } // namespace boost
104
105 #endif // BOOST_WINAPI_CHARACTER_CODE_CONVERSION_HPP_INCLUDED_