Espaces de noms
Variantes
Affichages
Actions

std::ios_base::failure

De cppreference.com
< cpp‎ | io‎ | ios base

 
 
D'entrée / sortie de bibliothèque
I / O manipulateurs
C-style I / O
Tampons
Original:
Buffers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf
basic_filebuf
basic_stringbuf
strstreambuf (obsolète)
Cours d'eau
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Abstractions
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base
basic_ios
basic_istream
basic_ostream
basic_iostream
Fichier E / 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.
basic_ifstream
basic_ofstream
basic_fstream
Chaîne 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.
basic_istringstream
basic_ostringstream
basic_stringstream
Tableau 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.
istrstream (obsolète)
ostrstream (obsolète)
strstream (obsolète)
Types
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
streamoff
streamsize
fpos
Interface catégorie d'erreur
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)
io_errc (C++11)
 
ios_base::failure
Les fonctions membres
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
failure::failure
 
Defined in header <ios>
class failure;
Le std::ios_base::failure classe définit un objet d'exception qui est levée en cas d'échec par les fonctions d'entrée / sortie .. bibliothèque
Original:
The class std::ios_base::failure defines an exception object that is thrown on failure by the functions in the Input/Output library.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cpp/error/exceptionstd-ios base-failure-2003-inheritance.svg
À propos de cette image

Inheritance diagram  (avant C++11)

cpp/error/exceptioncpp/error/runtime errorcpp/error/system errorstd-ios base-failure-inheritance.svg
À propos de cette image

Inheritance diagram  (depuis C++11)

Sommaire

[modifier] Fonctions membres

construit l'objet exception
Original:
constructs the exception object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction membre publique) [edit]

Inherited from std::system_error

Member functions

renvoie le code d'erreur
Original:
returns error code
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction membre publique de std::system_error) [edit]
[
virtuel
Original:
virtual
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
renvoie une chaîne explicative
Original:
returns explanatory string
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(function membre virtuelle publique de std::system_error) [edit]

Inherited from std::runtime_error


Inherited from std::exception

Member functions

[
virtuel
Original:
virtual
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
Détruit l'objet exception
Original:
destructs the exception object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(function membre virtuelle publique de std::exception) [edit]
[
virtuel
Original:
virtual
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
retourne une chaîne explicative
Original:
returns an explanatory string
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(function membre virtuelle publique de std::exception) [edit]

[modifier] Exemple

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

Résultat :

Caught an ios_base::failure.
Explanatory string: ios_base::clear: unspecified iostream_category error
Error code: iostream:1

[modifier] Voir aussi

(C++11)
les codes d'erreur IO cours d'eau
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]