名前空間
変種
操作

std::io_errc

提供: cppreference.com
< cpp‎ | io

 
 
入力/出力ライブラリ
I / Oのマニピュレータ
CスタイルのI / O
バッファ
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(廃止予定)
ストリーム
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
抽象化
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
ファイル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
文字列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
アレイの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(廃止予定)
ostrstream(廃止予定)
strstream(廃止予定)
タイプ
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
エラーカテゴリインターフェース
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)
 
std::io_errc
ヘルパークラス
Original:
Helper classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
is_error_code_enum<std::io_errc>
ヘルパー関数
Original:
Helper functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
make_error_code(std::io_errc)
make_error_condition(std::io_errc)
 
Defined in header <ios>
enum class io_errc;
(C++11およびそれ以降)
スコープの列挙std::io_errcstd::ios_base::failure例外オブジェクトのI / Oストリームによって報告されたエラーコードを定義します。実装は追加のエラーコードを定義するかもしれませんが、唯一つのエラー·コード(std::io_errc::stream)が必要です。 stdの適切な分業:: is_error_code_enumが提供されているため、この型の値はstd::io_errcstd::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.

目次

[編集] メンバー定数

列挙定数
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

[編集] も参照してください

プラットフォーム依存のエラーコードを取得しています
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.

(クラス) [edit]
携帯用のエラーコードを取得しています
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.

(クラス) [edit]
ストリーム例外
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) [edit]