Cpp-standard-library-cpp-basic-istream

提供:Dev Guides
移動先:案内検索

C ++ライブラリ-<basic_istream>

前書き

入力ストリームオブジェクトが文字のシーケンスから入力を読み取って解釈できるようにするために使用されます。 これらの入力操作を実行するための特定のメンバーが提供されます。

標準オブジェクトcinおよびwcinは、このクラステンプレートの特定のインスタンス化を使用します。

定義

以下はstd
basic_istreamの定義です。
template <class charT, class traits = char_traits<charT>>
   class basic_istream;

パラメーター

  • charT -文字タイプ。
  • traits -ストリームオブジェクトで使用される文字の基本的なプロパティを定義する文字特性クラス。

メンバーの種類

Sr.No. Member types Definition
1 event Type to indicate event type
2 event_callback Event callback function type
3 failure Base class for stream exceptions
4 fmtflags Type for stream format flags
5 Init Initialize standard stream objects
6 iostate Type for stream state flags
7 openmode Type for stream opening mode flags
8 seekdir Type for stream seeking direction flag

パブリックメンバー関数

Sr.No. Member types Definition
1 (constructor) Construct object (public member function )
2 (destructor) Destruct object (public member function )

書式付き入力

Sr.No. Input Definition
1 input Extract formatted input

書式なし入力

Sr.No. Input Definition
1 gcount It is used to get character count
2 get It is used to get characters
3 getline It is used to get line
4 ignore It is used to extract and discard characters
5 peek It is used to peek next character
6 read It is used to read block of data
7 readsome It is used to Read data available in buffer
8 putback It is used to put character back
9 unget It is used to unget character

ポジショニング

Sr.No. Position Definition
1 tellg It is used to get position in input sequence
2 seekg It is used to set position in input sequence

同期

Sr.No. Synchronization Definition
1 sync It is used to synchronize input buffer

保護されたメンバー関数

Sr.No. Member Functions Definition
1 /cpp_standard_library/cpp_basic_ios_operator_equal It is used to move assignment
2 swap It is used to swap internals

状態フラグ関数

Sr.No. Member types Definition
1 good It is used to check whether state of stream is good
2 eof It is used to check whether eofbit is set
3 fail It is used to check whether either failbit or badbit is set
4 bad It is used to check whether badbit is set
5 operator! Evaluate stream
6 rdstate It is used to get error state flags
7 setstate It is used to set error state flag
8 clear It is used to set error state flag
9 fill Get/set fill character
10 exceptions It is used to get/set exceptions mask
11 imbue Imbue locale
12 tie It is used to get/set tied stream
13 rdbuf It is used to get/set stream buffer
14 narrow Narrow character
15 widen Widen character