std::fpos<State>::state
提供: cppreference.com
<tbody>
</tbody>
State state() const; |
(1) | |
void state( State st ); |
(2) | |
ファイル位置状態を管理します。
1) ファイル位置状態の値を返します。
2) ファイル位置状態を
st の値で置き換えます。標準ライブラリで使用される std::fpos の特殊化では、 State は必ず std::mbstate_t です。
引数
| st | - | 状態の新しい値 |
戻り値
1) fpos の状態の現在の値。
2) (なし)
例
Run this code
#include <iostream>
#include <sstream>
#include <cwchar>
int main()
{
std::istringstream s("test");
std::mbstate_t st = s.tellg().state();
if(std::mbsinit(&st))
std::cout << "The stream is in the initial shift state\n";
}
出力:
The stream is in the initial shift state
関連項目
| マルチバイト文字列を反復処理するために必要な変換状態情報 (クラス) |