std::ios_base::iostate
Da cppreference.com.
![]() |
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
typedef /*implementation defined*/ iostate; |
||
static constexpr iostate goodbit = 0; |
||
static constexpr iostate badbit = /*implementation defined*/ static constexpr iostate failbit = /*implementation defined*/ |
||
Specifica i flag di stato del flusso. È un
BitmaskType
, le costanti sono: 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 | nessun errore
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 | flusso di errore irrecuperabile
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 | di input / output non riuscita (errore di formattazione o di estrazione)
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 | sequenza di input associati ha raggiunto la fine del file
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. |
Indice |
[modifica] Il eofbit
Il eofbit è fissato dalle seguenti funzioni standard di libreria:
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.
- La stringa di input std::getline funzione se termina perché viene raggiunta la fine del flusso, al contrario di raggiungere un determinato carattere di terminazione.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. - Gli overload di input numerici basic_istream::operator>> se la fine del flusso è stato rilevato durante la lettura del carattere successivo, on Stage 2 del trattamento num_get::get. A seconda dello stato parsing,
failbit
può o non può essere impostato al tempo stesso: per esempio, int n; istringstream buf("1"); buf >> n; insiemieofbit
, ma nonfailbit
: il 1 intero è stato analizzato correttamente e memorizzati inn
. D'altra parte, bool b; istringstream buf("tr"); buf >> boolalpha >> b; imposta siaeofbit
efailbit
: non c'era abbastanza caratteri per completare l'analisi del 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. - I sovraccarichi di estrazione di carattere operator>>std::basic_istream, se la fine del flusso viene raggiunto prima del limite (se presente) del numero di caratteri da estrarre.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. - L'I / O manipolatore std::get_time e una delle funzioni di analisi delle std::time_get: time_get::get, time_get::get_time, time_get::get_date, ecc, se la fine del flusso viene raggiunta prima che il carattere necessario per analizzare il previsto valore data / ora è stato elaborato.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. - L'I / O manipolatore std::get_money e funzione money_get::get, se la fine del flusso viene raggiunta prima che il carattere necessario per analizzare il valore monetario atteso è stato elaborato.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. - Il costruttore basic_istream::sentry, eseguita all'inizio di ogni funzione di input formattata: a meno che il bit
skipws
è impostata (ad esempio, mediante l'emissione di std::noskipws), sentinella legge e scarta i protagonisti di spaziatura. Se la fine del flusso di ingresso viene raggiunto durante questa operazione, siaeofbit
failbit
e sono impostati, e nessun ingresso avviene.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. - L'I / O std::ws manipolatore, se raggiunge la fine del flusso consumando spazi bianchi (ma, a differenza della sentinella input formattata, non imposta
failbit
in questo 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. - Le funzioni di input non formattato basic_istream::read, basic_istream::get, basic_istream::getline e, una volta raggiunta la fine del flusso.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. - L'ingresso basic_istream::ignore scarti funzione, quando si raggiunge la fine del flusso prima di raggiungere il carattere delimitatore specificato.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. - L'immediato basic_istream::readsome funzione di ingresso, se basic_streambuf::in_avail restituisce -1Original:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Le seguenti funzioni cancellare
eofbit
come un effetto collaterale: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.
[modifica] Il failbit
Il failbit è fissato dalle seguenti funzioni standard di libreria:
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 |
[modifica] Il badbit
Il badbit è fissato dalle seguenti funzioni standard di libreria:
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 |
[modifica] Esempio
This section is incomplete Reason: no example |
[modifica] Vedi anche
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 |