std::ios_base::iostate
提供:cppreference.com
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
typedef /*implementation defined*/ iostate; |
||
static constexpr iostate goodbit = 0; |
||
static constexpr iostate badbit = /*implementation defined*/ static constexpr iostate failbit = /*implementation defined*/ |
||
ストリームの状態フラグを指定します。それは
BitmaskType
で、以下の定数が定義されています Original:
Specifies stream state flags. It is a
BitmaskType
, the following constants are defined: The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
定数
Original: Constant The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Explanation |
goodbit | エラーなし
Original: no error The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
badbit | 回復不能なストリームエラー
Original: irrecoverable stream error The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
failbit | 入力/出力操作(書式設定や抽出誤差)に失敗しました
Original: input/output operation failed (formatting or extraction error) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
eofbit | 関連する入力シーケンスはファイルの終わりに達している
Original: associated input sequence has reached end-of-file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
目次 |
[編集] eofbit
eofbitは、次の標準ライブラリ関数によって設定されます
Original:
The eofbit is set by the following standard library functions:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
- 文字列入力機能std::getlineそれは指定された終了文字に到達するとは対照的に、ストリームの最後に到達することによって完了した場合は.Original:The string input function std::getline if it completes by reaching the end of the stream, as opposed to reaching the specified terminating character.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - basic_istream::operator>>処理のステージ2で、次の文字を読みながら、ストリームの終わりに達した場合はnum_get::getの数値入力オーバーロード。解析状態に応じて、
failbit
は五月または同時に設定できないことがあります:例えば、int n; istringstream buf("1"); buf >> n;セットeofbit
なく、failbit
:整数1は正常に解析され、n
に格納されていました。一方、bool b; istringstream buf("tr"); buf >> boolalpha >> b;は両方eofbit
とfailbit
を設定します。booleantrueの解析を完了するのに十分な文字がありませんでした.Original:The numeric input overloads of basic_istream::operator>> if the end of the stream was encountered while reading the next character, on Stage 2 of num_get::get processing. Depending on the parsing state,failbit
may or may not be set at the same time: for example, int n; istringstream buf("1"); buf >> n; setseofbit
, but notfailbit
: the integer 1 was successfully parsed and stored inn
. On the other hand, bool b; istringstream buf("tr"); buf >> boolalpha >> b; sets botheofbit
andfailbit
: there was not enough characters to complete the parsing of the boolean true.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - ストリームの終わりに抽出する文字数の制限(もしあれば)の前に到達した場合operator>>std::basic_istreamの文字抽出オーバーロード、.Original:The character extraction overloads of operator>>std::basic_istream, if the end of the stream is reached before the limit (if any) on the number of characters to be extracted.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - I / Oは、マニピュレータとstd::get_time解析関数のいずれstd::time_get:time_get::get、time_get::get_time、time_get::get_dateなど、最後の文字は値が処理された期待通りの日付/時刻を解析するために必要とされる前にストリームの終わりに達した場合は.Original:The std::get_time I/O manipulator and any of the std::time_get parsing functions: time_get::get, time_get::get_time, time_get::get_date, etc., if the end of the stream is reached before the last character needed to parse the expected date/time value was processed.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - std::get_moneyI / Oのマニピュレータとmoney_get::get機能、期待される金銭的価値を解析するために必要な最後の文字が処理される前にストリームの終わりに達した場合は.Original:The std::get_money I/O manipulator and money_get::get function, if the end of the stream is reached before the last character needed to parse the expected monetary value was processed.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - すべての書式付き入力関数の先頭で実行basic_istream::sentryコンストラクタは、:
skipws
ビットが設定されていない限り(std::noskipwsを発行するなどして)、歩哨の読み取りと先行する空白文字を破棄します。入力ストリームの終わりにこの操作中に到達した場合、eofbit
とfailbit
設定して、かつ入力が行われていない両方の.Original:The basic_istream::sentry constructor, executed at the beginning of every formatted input function: unless theskipws
bit is unset (e.g. by issuing std::noskipws), sentry reads and discards the leading whitespace characters. If the end of the input stream is reached during this operation, botheofbit
andfailbit
are set, and no input takes place.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - I / Oのマニピュレータstd::ws、それはストリームの終わりに達した場合、消費電力は空白文字(ただし、書式設定された入力歩哨とは違って、それが設定されていません
failbit
このケースでは)Original:The I/O manipulator std::ws, if it reaches the end of the stream while consuming whitespace (but, unlike the formatted input sentry, it does not setfailbit
in this case)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - フォーマットされていない入力機能basic_istream::read、basic_istream::get、そしてbasic_istream::getline、ストリームの終わりに達した.Original:The unformatted input functions basic_istream::read, basic_istream::get, and basic_istream::getline, when reaching the end of the stream.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - 指定された区切り文字に到達する前にストリームの終わりに達した廃棄入力機能basic_istream::ignore、.Original:The discard input function basic_istream::ignore, when reaching the end of the stream before reaching the specified delimiter character.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - 即時入力機能basic_istream::readsome、もしbasic_streambuf::in_avail戻り-1Original:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
副作用として、以下の機能を明確
eofbit
:Original:
The following functions clear
eofbit
as a side-effect:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] failbitが
failbitが、次の標準ライブラリ関数によって設定されます
Original:
The failbit is set by the following standard library functions:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
This section is incomplete |
[編集] badbitを
badbitを次の標準ライブラリ関数によって設定されます
Original:
The badbit is set by the following standard library functions:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
This section is incomplete Reason: move from ios_base::bad and expand |
[編集] 例
This section is incomplete Reason: no example |
[編集] も参照してください
ios_base::iostate flags | basic_ios accessors | |||||||
eofbit | failbit | badbit | good() | fail() | bad() | eof() | operator bool() | operator!() |
false | false | false | true | false | false | false | true | false |
false | false | true | false | true | true | false | false | true |
false | true | false | false | true | false | false | false | true |
false | true | true | false | true | true | false | false | true |
true | false | false | false | false | false | true | true | false |
true | false | true | false | true | true | true | false | true |
true | true | false | false | true | false | true | false | true |
true | true | true | false | true | true | true | false | true |