名前空間
変種
操作

std::wbuffer_convert::rdbuf

提供: cppreference.com

 
 
ローカライゼーションライブラリ
ロケールおよびファセット
Original:
Locales and facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
locale
文字分類
Original:
Character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
変換
Original:
Conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ファセットカテゴリの基底クラスです
Original:
Facet category base classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ファセットカテゴリ
Original:
Facet categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ロケール固有のファセット
Original:
Locale-specific facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
コー​​ド変換ファセット
Original:
Code conversion facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
codecvt_utf8(C++11)
codecvt_utf16(C++11)
Cロケール
Original:
C locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
std::wbuffer_convert
メンバ関数
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
wbuffer_convert::wbuffer_convert
wbuffer_convert::~wbuffer_convert
wbuffer_convert::rdbuf
wbuffer_convert::state
 
Defined in header <locale>
std::streambuf* rdbuf() const;
(1)
std::streambuf* rdbuf( std::streambuf* bytebuf );
(2)
1)
基本となるバイトストリームへのポインタを返します
Original:
returns the pointer to the underlying byte stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
bytebufに関連付けられたバイトストリームを置き換えます
Original:
replaces the associated byte stream with bytebuf
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

.

[編集] 値を返します

1)
現在の基本となるバイトストリーム
Original:
the current underlying byte stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
以前のバイトストリーム
Original:
the previous byte stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

#include <iostream>
#include <sstream>
#include <locale>
#include <codecvt>
int main()
{
    // convert UTF-8 to UCS4
    std::stringbuf utf8buf(u8"z\u00df\u6c34\U0001d10b");  // or u8"zß水𝄋"
                       // or "\x7a\xc3\x9f\xe6\xb0\xb4\xf0\x9d\x84\x8b";
    std::wbuffer_convert<std::codecvt_utf8<wchar_t>> conv(&utf8buf);
    std::wistream ucsbuf(&conv);
    std::cout << "Reading from a UTF-8 stringbuf via wbuffer_convert:\n";
    for(wchar_t c; ucsbuf.get(c); )
        std::cout << std::hex << std::showbase << c << '\n';
 
    // reuse the same wbuffer_convert to handle UCS4 to UTF-8 output
    conv.rdbuf(std::cout.rdbuf());
    std::wostream out(&conv);
    std::cout << "Sending UCS4 data to std::cout via wbuffer_convert:\n";
    out << L"z\u00df\u6c34\U0001d10b\n";
}

Output:

Reading from a UTF-8 stringbuf via wbuffer_convert:
0x7a
0xdf
0x6c34
0x1d10b
Sending UCS4 data to std::cout via wbuffer_convert:
zß水𝄋

[編集] も参照してください

新しいwbuffer_convertを構築します
Original:
constructs a new wbuffer_convert
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]