fposクラステンプレート -- ファイルの位置情報
ヘッダ
#include <ios>
定義
template <typename stateT>
class fpos
{
public:
// int からオブジェクトを構築 (※1)
fpos(int i);
// streamoff との変換 (※1)
fpos(streamoff offset);
operator streamoff() const;
// シフト状態
stateT state() const;
void state(stateT);
// 等号/不等号 (※1)
bool operator==(const fpos& rhs) const;
bool operator!=(const fpos& rhs) const;
// オフセットによる加算・減算 (※1)
fpos operator+(streamoff offset) const;
fpos operator-(streamoff offset) const;
fpos& operator+=(streamoff offset);
fpos& operator-=(streamoff offset);
streamoff operator-(const fpos& rhs) const;
};
// (※1) 必ずしもメンバ関数である必要はない
クラスの説明
このクラスのインスタンスはストリーム上の位置を示す。
stateT テンプレートパラメータは、mbstate_t などのマルチバイトのシフト状態。
次の機能を持つ。
- シフト状態の参照/設定
- streamoff 型との相互変換
- オフセットによる加算・減算
最終更新:2008年03月08日 08:37