名前空間
変種
操作

「cpp/io/basic ios/init」の版間の差分

提供: cppreference.com
< cpp‎ | io‎ | basic ios
(Fix some translations)
 
1行: 1行:
{{tr_note}}
 
 
{{cpp/io/basic_ios/title | init}}
 
{{cpp/io/basic_ios/title | init}}
 
{{cpp/io/basic_ios/navbar}}
 
{{cpp/io/basic_ios/navbar}}
7行: 6行:
 
}}
 
}}
  
{{tr|{{tt|sb}}に関連付けられたストリームバッファを設定し、内部状態を初期化.|Sets the associated stream buffer to {{tt|sb}} and initializes the internal state.}}
+
{{tt|sb}}
  
{{tr|事後条件は次のとおりです|The postconditions are as follows:}}
+
  
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Element
+
!
! Value
+
!
 
|-
 
|-
| {{rlpf|rdbuf}} || {{tt|sb}}
+
| {{|rdbuf}} || {{tt|sb}}
 
|-
 
|-
| {{rlpf|tie}} || {{lc|NULL}}
+
| {{|tie}} ||
 
|-
 
|-
| {{rlpf|rdstate}} || {{tt|goodbit}} if {{tt|sb}} is not {{lc|NULL}}, otherwise {{tt|badbit}}
+
| {{|rdstate}} || {{tt|}} {{tt|}}{{tt|badbit}}
 
|-
 
|-
| {{rlpf|exceptions}} || {{tt|goodbit}}
+
| {{|exceptions}} || {{tt|goodbit}}
 
|-
 
|-
 
| {{ltf|cpp/io/ios_base/flags}} || {{c|skipws {{!}} dec}}
 
| {{ltf|cpp/io/ios_base/flags}} || {{c|skipws {{!}} dec}}
30行: 29行:
 
| {{ltf|cpp/io/ios_base/precision}} || {{c|6}}
 
| {{ltf|cpp/io/ios_base/precision}} || {{c|6}}
 
|-
 
|-
| {{rlpf|fill}} || {{c|widen(' ')}}
+
| {{|fill}} || {{c|widen(' ')}}
 
|-
 
|-
| {{ltf|cpp/io/ios_base/getloc}} || a copy of the value returned by {{c|std::locale()}}
+
| {{ltf|cpp/io/ios_base/getloc}} || {{c|std::locale()}}
 
|}
 
|}
  
{{tr|このメンバ関数は、保護されています:それは{{lc|std::basic_istream}}と{{lc|std::basic_ostream}}一度関連付けられたストリームバッファが知られている派生ストリームクラスのコンストラクタによって呼び出されます。この関数が呼び出されるまで、デフォルトに構築{{lc|std::basic_ios}}のすべてのメンバ関数(デストラクタ以外)は未定義の動作を呼び出します。 {{tt|basic_ios}}、仮想基底クラスであり、したがって、そのコンストラクタが2段階の初期化が必要な理由であるそれらの直接派生クラスのコンストラクタによって呼び出されないことに注意してください.|This member function is protected: it is called by the constructors of the derived stream classes {{lc|std::basic_istream}} and {{lc|std::basic_ostream}} once the associated stream buffer is known. Until this function is called, every member function (other than the destructor) of the default-constructed {{lc|std::basic_ios}} invokes undefined behavior. Note that {{tt|basic_ios}} is a virtual base class, and therefore its constructor is not called by the constructors of those directly derived classes, which is why two-stage initialization is necessary.}}
+
protected {{lc|std::basic_istream}} {{lc|std::basic_ostream}} () {{tt|basic_ios}}
  
===パラメータ===
+
======
 
{{par begin}}
 
{{par begin}}
{{par | sb |{{tr| ストリームバッファに関連付けることができます| stream buffer to associate to}}}}
+
{{par | sb | }}
 
{{par end}}
 
{{par end}}
  
===参照===
+
======
 
{{dsc begin}}
 
{{dsc begin}}
 
{{dsc inc | cpp/io/basic_ios/dsc constructor}}
 
{{dsc inc | cpp/io/basic_ios/dsc constructor}}
 
{{dsc end}}
 
{{dsc end}}
  
[[de:cpp/io/basic ios/init]]
+
deenesfritptruzh
[[en:cpp/io/basic ios/init]]
+
[[es:cpp/io/basic ios/init]]
+
[[fr:cpp/io/basic ios/init]]
+
[[it:cpp/io/basic ios/init]]
+
[[pt:cpp/io/basic ios/init]]
+
[[ru:cpp/io/basic ios/init]]
+
[[zh:cpp/io/basic ios/init]]
+

2018年6月2日 (土) 19:29時点における最新版

 
 
入出力ライブラリ
入出力マニピュレータ
Cスタイルの入出力
バッファ
(C++98で非推奨)
ストリーム
抽象
ファイル入出力
文字列入出力
配列入出力
(C++98で非推奨)
(C++98で非推奨)
(C++98で非推奨)
同期化出力
エラーカテゴリインタフェース
(C++11)
 
 
protected:
void init( std::basic_streambuf<CharT,Traits>* sb );

紐付けられるストリームバッファを sb に設定し、内部状態を初期化します。

事後条件は以下の通りです。

要素
rdbuf() sb
tie() ヌルポインタ
rdstate() sb がヌルポインタでなければ goodbit、そうでなければ badbit
exceptions() goodbit
flags() skipws | dec
width() 0
precision() 6
fill() widen(' ')
getloc() std::locale() によって返される値のコピー

このメンバ関数は protected です。 紐付けるストリームバッファが判明したときに派生ストリームクラスのコンストラクタ std::basic_istream および std::basic_ostream から呼ばれます。 この関数が呼ばれるまで、すべてのメンバ関数 (デストラクタを含む) の呼び出しは未定義動作です。 basic_ios は仮想基底クラスであり、そのためそのコンストラクタはこれらの直接の派生クラスのコンストラクタからは呼ばれないことに注意してください。 それが2ステージの初期化を必要とする理由です。

[編集] 引数

sb - 紐付けるストリームバッファ

[編集] 関連項目

オブジェクトを構築します
(パブリックメンバ関数) [edit]