名前空間
変種

std::wstring_convert

提供: cppreference.com
 
 
 
 
<tbody> </tbody>
ヘッダ <locale> で定義
template< class Codecvt, class Elem = wchar_t, class Wide_alloc = std::allocator<Elem>, class Byte_alloc = std::allocator<char> > class wstring_convert;
(C++11以上)
(C++17で非推奨)

クラステンプレート std::wstring_convert は、個別のコード変換ファセット Codecvt を用いて、バイト文字列 std::string とワイド文字列 std::basic_string<Elem> 間の変換を行います。 std::wstring_convert は変換ファセットの所有権を仮定します。 ロケールによって管理されているファセットは使用できません。 std::wstring_convert での使用に適した標準のファセットは、 UTF-8/UCS2 および UTF-8/UCS4 の変換に対しては std::codecvt_utf8、 UTF-8/UTF-16 の変換に対しては std::codecvt_utf8_utf16 です。

メンバ型

メンバ型 定義
byte_string std::basic_string<char, char_traits<char>, Byte_alloc>
wide_string std::basic_string<Elem, char_traits<Elem>, Wide_alloc>
state_type Codecvt::state_type
int_type wide_string::traits_type::int_type

メンバ関数

新しい wstring_convert を構築します
(パブリックメンバ関数) [edit]
operator=
コピー代入演算子は削除されています
(パブリックメンバ関数)
wstring_convert およびその変換ファセットを破棄します
(パブリックメンバ関数) [edit]
バイト文字列をワイド文字列に変換します
(パブリックメンバ関数) [edit]
ワイド文字列をバイト文字列に変換します
(パブリックメンバ関数) [edit]
変換に成功した文字数を返します
(パブリックメンバ関数) [edit]
現在の変換状態を返します
(パブリックメンバ関数) [edit]

関連項目

文字変換 ロケール定義のマルチバイト
(UTF-8, GB18030)
UTF-8
UTF-16
UTF-16 mbrtoc16 / c16rtomb(C11のDR488あり) codecvt<char16_t, char, mbstate_t>
codecvt_utf8_utf16<char16_t>
codecvt_utf8_utf16<char32_t>