std::ios_base::iostate
Da 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*/ |
||
Especifica os sinalizadores de estado de fluxo. É um
BitmaskType
, as seguintes constantes são definidas: 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.
Constante
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 | nenhum erro
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 | erro de fluxo de irrecuperável
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 | entrada / saída de operação falhou (formatação ou erro de extração)
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 | seqüência de entrada associado atingiu o fim-de-arquivo
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. |
Índice |
[editar] O eofbit
O eofbit é definido pelos seguintes funções da biblioteca padrão:
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.
- A seqüência de std::getline função de entrada se completa ao atingir o final do fluxo, em vez de alcançar o caractere especificado terminando.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. - As sobrecargas de entrada numéricos de basic_istream::operator>> se o fim do fluxo foi encontrado ao ler o caractere seguinte, em 2 ª fase de processamento num_get::get. Dependendo do estado a análise,
failbit
pode ou não pode ser definida ao mesmo tempo: por exemplo, os conjuntos int n; istringstream buf("1"); buf >> n;eofbit
, mas nãofailbit
: a 1 inteiro foi analisado com êxito e armazenadas emn
. Por outro lado, bool b; istringstream buf("tr"); buf >> boolalpha >> b; define tantoeofbit
efailbit
: não havia caracteres suficientes para completar a análise do true boolean.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. - As sobrecargas de caracteres de extracção de operator>>std::basic_istream, se o fim do fluxo for atingido antes do limite (se for o caso) sobre o número de caracteres a serem extraídos.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. - O std::get_time manipulador I / O e qualquer uma das funções de análise std::time_get: time_get::get, time_get::get_time, time_get::get_date, etc, se o fim do fluxo for alcançado antes do último caractere necessário para analisar o valor de data / hora prevista foi processado.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. - O std::get_money manipulador I / O e função money_get::get, se o fim do fluxo for alcançado antes do último caractere necessário para analisar o valor monetário esperado foi processado.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. - O construtor basic_istream::sentry, executado no início de cada função de entrada formatada: a menos que o bit é
skipws
unset (por exemplo, através da emissão de std::noskipws), sentinela lê e descarta os personagens principais espaços em branco. Se o fim do fluxo de entrada é atingido durante esta operação, tantoeofbit
failbit
e são definidas, e nenhuma entrada tem lugar.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. - O manipulador std::ws I / O, se atinge o final do fluxo, enquanto consome espaço em branco (mas, ao contrário da sentinela entrada formatada, ele não define
failbit
, neste caso)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. - As funções de entrada não formatados basic_istream::read, basic_istream::get, e basic_istream::getline, quando chegar ao fim do fluxo.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. - O descarte basic_istream::ignore função de entrada, quando chegar ao fim do fluxo antes de atingir o caractere delimitador especificado.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. - O basic_istream::readsome função imediata entrada, se basic_streambuf::in_avail retorna -1Original:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
As seguintes funções de limpar
eofbit
como um efeito colateral: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.
[editar] O failbit
O failbit é definido pelos seguintes funções da biblioteca padrão:
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.
Esta seção está incompleta |
[editar] O badbit
O badbit é definido pelos seguintes funções da biblioteca padrão:
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.
Esta seção está incompleta Motivo: move from ios_base::bad and expand |
[editar] Exemplo
Esta seção está incompleta Motivo: sem exemplo |
[editar] Veja também
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 |