Espacios de nombres
Variantes

std::iostream_category

De cppreference.com
< cpp | io
 
 
Biblioteca de E/S
Manipuladores de E/S
E/S estilo C
Búferes
(en desuso en C++98)
Flujos
Abstracciones
E/S de archivos
E/S de cadenas
E/S de arrays
(en desuso en C++98)
(en desuso en C++98)
(en desuso en C++98)
Salida sincronizada
Tipos
Interfaz de categoría de error
(C++11)
 
Definido en el archivo de encabezado <ios>
const std::error_category& iostream_category();
(desde C++11)
Obtiene una referencia al objeto de error para los errores de categoría estática iostream. El objeto es necesaria para anular el error_category::name() función virtual para devolver un puntero a la cadena "iostream". Se utiliza para identificar los códigos de error previstos en las excepciones del tipo std::ios_base::failure .
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.

Parámetros

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

Valor de retorno

Una referencia al objeto estático de tipo no especificado de tiempo de ejecución, 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.

Excepciones

Especificación noexcept:  
noexcept
  (desde C++11)

Ejemplo

#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"
                  << "Error category: " << e.code().category().name() << '\n';
    }
}

Salida:

Caught an ios_base::failure.
Error category: iostream

Ver también

Excepción de flujo.
(clase miembro pública de std::ios_base) [editar]
(C++11)
los códigos IO secuencia de error
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) [editar]
Morty Proxy This is a proxified and sanitized view of the page, visit original site.