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.
| Constant
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: не было достаточного количества символов для завершения разбора логическое true.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,failbitmay 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 botheofbitandfailbit: 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. - std::get_time I / O манипулятора и любая из функций 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_money I / 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 theskipwsbit 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, botheofbitandfailbitare 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 setfailbitin 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.
| Этот раздел не завершён |
[править] 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.
| Этот раздел не завершён Причина: move from ios_base::bad and expand |
[править] Пример
| Этот раздел не завершён Причина: нет примера |
[править] См. также
| 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 |