Namensräume
Varianten
Aktionen

std::ios_base::failure

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

 
 
Input / Output-Bibliothek
I / O-Manipulatoren
C-style I / O
Puffern
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(veraltet)
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.
Abstraktionen
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
Datei-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.
basic_ifstream
basic_ofstream
basic_fstream
String 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
Array 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(veraltet)
ostrstream(veraltet)
strstream(veraltet)
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
Fehler Kategorie Schnittstelle
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
Member-Funktionen
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;
Die Klasse std::ios_base::failure definiert eine Ausnahme-Objekt, das bei Ausfall der Funktionen in der Input / Output-Bibliothek geworfen .
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
Über dieses Bild

Inheritance diagram (bis C + +11)

cpp/error/exceptioncpp/error/runtime errorcpp/error/system errorstd-ios base-failure-inheritance.svg
Über dieses Bild

Inheritance diagram (seit C++11)

Inhaltsverzeichnis

[Bearbeiten] Member-Funktionen

baut das Exception-Objekt
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.

(öffentliche Elementfunktion) [edit]

Inherited from std::system_error

Member functions

gibt den Fehlercode
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.

(öffentliche Elementfunktion of std::system_error) [edit]
[virtuell]
kehrt erklärende String
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.

(virtuellen öffentlichen Member-Funktion of std::system_error) [edit]

Inherited from std::runtime_error


Inherited from std::exception

Member functions

[virtuell]
zerstört sich die Ausnahme-Objekt
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.

(virtuellen öffentlichen Member-Funktion of std::exception) [edit]
[virtuell]
gibt einen erläuternden String
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.

(virtuellen öffentlichen Member-Funktion of std::exception) [edit]

[Bearbeiten] Beispiel

#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';
    }
}

Output:

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

[Bearbeiten] Siehe auch

(C++11)
die IO-Stream Fehlercodes
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]