std::io_errc
提供: cppreference.com
|
|
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
| 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"; } }
出力:
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)
| |