Cpp-standard-library-cpp-ios-iostate

提供:Dev Guides
移動先:案内検索

C ++ IOSライブラリ-ios_base iostate

説明

これはすべてのストリームオブジェクトに使用され、オブジェクトの状態に関する情報を内部的に保持します。 この情報は、メンバー関数basic_ios
rdstateを呼び出すか、basic_ios :: setstateを呼び出して設定することにより、このタイプの要素として取得できます。

これらの関数によって渡されて取得される値は、以下に示すように、次のメンバー定数の任意の有効な組み合わせ(ブールOR演算子「|」を使用)にすることができます-

flag value indicates
eofbit End-Of-File reached while performing an extracting operation on an input stream.
failbit The last input operation failed because of an error related to the internal logic of the operation itself.
badbit Error due to the failure of an input/output operation on the stream buffer.
goodbit No error. Represents the absence of all the above (the value zero).
これらの定数は、ios_baseクラスでパブリックメンバーとして定義されます。 したがって、名前はios_baseメンバー(ios_base
badbitなど)として直接参照するか、継承クラスやインスタンス化されたオブジェクト(ios :: eofbitやcin.goodbitなど)を使用して参照できます。