std::io_errc
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. |
Elemento definito nell'header <ios>
|
||
enum class io_errc; |
(dal C++11) | |
Il
std::io_errc
enumerazione ambito definisce i codici di errore segnalati dai flussi di I / O in oggetti eccezione std::ios_base::failure. Solo un codice di errore (std::io_errc::stream
) è richiesto, anche se l'attuazione può definire codici di errore. Poiché la specializzazione appropriata di std :: is_error_code_enum è previsto, valori di tipo std::io_errc
sono convertibile in modo implicito std::error_code.Original:
The scoped enumeration
std::io_errc
defines the error codes reported by I/O streams in std::ios_base::failure exception objects. Only one error code (std::io_errc::stream
) is required, although the implementation may define additional error codes. Because the appropriate specialization of std::is_error_code_enum is provided, values of type std::io_errc
are implicitly convertible to std::error_code.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.
Indice |
[modifica] Membri costanti
Enumerazione costante
Original: Enumeration constant The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Value |
stream
|
1 |
[modifica] Helper classi
estende il std::is_error_code_enum tratto tipo di identificare i codici di errore iostream Original: extends the type trait std::is_error_code_enum to identify iostream error codes The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
[modifica] Non membri funzioni
costruisce un codice di errore iostream Original: constructs an iostream error code The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) | |
costruisce un error_condition iostream Original: constructs an iostream error_condition The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) |
[modifica] Esempio
#include <iostream> #include <fstream> int main() { std::ifstream f("doesn't exist"); try { f.exceptions(f.failbit); } catch (const std::ios_base::failure& e) { std::cout << "Caught an ios_base::failure.\n"; if(e.code() == std::io_errc::stream) std::cout << "The error code is std::io_errc::stream\n"; } }
Output:
Caught an ios_base::failure. The error code is std::io_errc::stream
[modifica] Vedi anche
(C++11) |
in possesso di un dipendente dalla piattaforma codice di errore Original: holds a platform-dependent error code The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
(C++11) |
contiene un codice di errore portatile Original: holds a portable error code The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
flusso di eccezione Original: stream exception The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico of std::ios_base classe)
|