Espaços nominais
Variantes
Acções

std::iostream_category

Da cppreference.com
< cpp‎ | io

 
 
De entrada / saída da biblioteca
I / O manipuladores
C estilo de I / O
Buffers
Original:
Buffers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(obsoleta)
Streams
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Abstrações
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
File I / O
Original:
File I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Cordas I / O
Original:
String I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Matriz de I / O
Original:
Array I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(obsoleta)
(obsoleta)
(obsoleta)
Tipos
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Interface de categoria de erro
Original:
Error category interface
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iostream_category
(C++11)
(C++11)
 
Definido no cabeçalho <ios>
conststd::error_category& iostream_category();
(desde C++11)
Obtém uma referência para o objeto estático erro categoria para erros iostream. O objeto é necessária para substituir o error_category::name() função virtual para retornar um ponteiro para a "iostream" string. Ele é utilizado para identificar os códigos de erro fornecidos nas excepções de std::ios_base::failure tipo.
Original:
Obtains a reference to the static error category object for iostream errors. The object is required to override the virtual function error_category::name() to return a pointer to the string "iostream". It is used to identify error codes provided in the exceptions of type std::ios_base::failure.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Índice

[editar]Parâmetros

(Nenhum)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar]Valor de retorno

Uma referência ao objeto estático do tipo não especificado de tempo de execução, derivado de std::error_category.
Original:
A reference to the static object of unspecified runtime type, derived from std::error_category.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar]Exceções

noexcept specification:  
noexcept
  (desde C++11)

[editar]Exemplo

#include <iostream>#include <fstream>   int main(){std::ifstream f("doesn't exist");try{ f.exceptions(f.failbit);}catch(conststd::ios_base::failure& e){std::cout<<"Caught an ios_base::failure.\n"<<"Error category: "<< e.code().category().name()<<'\n';}}

Saída:

Caught an ios_base::failure. Error category: iostream

[editar]Veja também

exceção fluxo
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.

(of std::ios_base public class membro)[edit]
(C++11)
O erro de IO códigos de fluxo
Original:
the IO stream error codes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(enum)[edit]
close