std::io_errc
提供:cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <ios>
|
||
| enum class io_errc; |
(C + + 11以来) | |
スコープの列挙
std::io_errcはstd::ios_base::failure例外オブジェクトのI / Oストリームによって報告されたエラーコードを定義します。実装は追加のエラーコードを定義するかもしれませんが、唯一つのエラー·コード(std::io_errc::stream)が必要です。 stdの適切な分業:: is_error_code_enumが提供されているため、この型の値はstd::io_errcは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.
目次 |
[編集] メンバー定数
| 列挙定数
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 |
[編集] ヘルパークラス
| iostreamのエラーコードを識別する型形質std::is_error_code_enumを拡張します 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. (クラステンプレート) | |
[編集] 非メンバ関数
| 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. (機能) | |
| iostreamのerror_conditionを構築します 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. (機能) | |
[編集] 例
#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
[編集] も参照してください
| (C++11) |
プラットフォーム依存のエラーコードを取得しています 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. (クラス) |
| (C++11) |
携帯用のエラーコードを取得しています 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. (クラス) |
| ストリーム例外 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. (publicメンバクラスof std::ios_base)
| |