std::basic_streambuf<CharT,Traits>::pubseekpos、std::basic_streambuf<CharT,Traits>::seekpos
From cppreference.com
< cpp | io | basic streambuf
| pos_type pubseekpos( pos_type pos, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out ); |
(1) | |
| protected: virtual pos_type seekpos( pos_type pos, |
(2) | |
入力および/または出力シーケンスの位置指示器を絶対位置に設定します。
1) 最も派生したクラスの seekpos(pos, which) を呼び出します。
2) この関数の基底クラスバージョンは何も効果がありません。派生クラスは、位置指示器の絶対配置を許可するためにこの関数をオーバーライドすることができます。
目次 |
[編集] パラメータ
| pos | - | 位置指示器を設定する絶対位置 | ||||||
| which | - | 入力および/または出力シーケンスのどちらに影響するかを定義します。次の定数のいずれか、またはそれらの組み合わせにすることができます。
|
[編集] 戻り値
1) seekpos(pos, which) の戻り値。
2) 位置指示器によって定義される結果の絶対位置。基底クラスバージョンは pos_type(off_type(-1)) を返します。
[編集] 例
| このセクションは未完成です 理由: 例がありません |
[編集] 不具合報告
以下の動作変更を伴う欠陥報告が、以前に公開されたC++標準に遡って適用されました。
| DR | 適用対象 | 公開された動作 | 正しい動作 |
|---|---|---|---|
| LWG 55 | C++98 | seekpos の基底クラスバージョンは返しました未定義の無効なストリーム位置 |
pos_type(off_type(-1)) を返します |
[編集] 関連項目
| seekoff() を呼び出す (public member function) | |
| [virtual] |
絶対アドレスを使用してファイル位置を再配置します (virtual protected member function of std::basic_filebuf<CharT,Traits>) |
| [virtual] |
入力シーケンス、出力シーケンス、またはその両方で、絶対アドレス指定を使用して次のポインタを再配置する (virtual protected member function of std::basic_stringbuf<CharT,Traits,Allocator>) |
| [virtual] |
入力シーケンス、出力シーケンス、またはその両方で、絶対アドレス指定を使用して次のポインタを再配置する (virtual protected member function of std::strstreambuf) |