名前空間
変種
操作

「cpp/named req/UnformattedInputFunction」の版間の差分

提供: cppreference.com
< cpp‎ | named req
(Use {{lc}}. Update links. Various fixes.)
 
(1人の利用者による、間の1版が非表示)
1行: 1行:
{{tr_note}}
+
{{cpp//title|UnformattedInputFunction}}
{{cpp/concept/title|UnformattedInputFunction}}
+
{{cpp//navbar}}
{{cpp/concept/navbar}}
+
  
 
===要件===
 
===要件===
{{tr|:{{tt|UnformattedInputFunction}}は以下を実行し、ストリーム入力機能です|An {{tt|UnformattedInputFunction}} is a stream input function that performs the following:}}
 
  
* {{tr|自動記憶域期間を持つと次のことを実行{{l2tt|cpp/io/basic_istream/sentry}}に設定{{tt|noskipws}}の引数を持つ型{{c|true}}のオブジェクトを構築します|Constructs an object of type {{l2tt|cpp/io/basic_istream/sentry}} with automatic storage duration and with the {{tt|noskipws}} argument set to {{c|true}}, which performs the following}}
+
{{/|}}
:* {{tr|もし{{ltt|cpp/io/ios_base/iostate|eofbit}}または{{ltt|cpp/io/ios_base/iostate|badbit}}入力ストリームに設定されているだけでなく、{{tt|failbit}}を設定し、failbitは上の例外がこの入力ストリームの例外マスクで有効になっている場合、{{l2tt|cpp/io/ios_base/failure}}をスロー.|if {{ltt|cpp/io/ios_base/iostate|eofbit}} or {{ltt|cpp/io/ios_base/iostate|badbit}} are set on the input stream, sets the {{tt|failbit}} as well, and if exceptions on failbit are enabled in this input stream's exception mask, throws {{l2tt|cpp/io/ios_base/failure}}.}}
+
 
:* {{tr|フラッシュするのtie() 'dの出力ストリーム(該当する場合)|flushes the tie()'d output stream, if applicable}}
+
{{l2tt|cpp/io/basic_istream/sentry}} {{tt|noskipws}} {{c|true}}
* {{tr|{{tt|sentry::operator bool()}}と同等です{{l2tt|cpp/io/basic_ios/good}}を呼び出すことによって、見張りの状態をチェックし.|Checks the status of the sentry by calling {{tt|sentry::operator bool()}}, which is equivalent to {{l2tt|cpp/io/basic_ios/good}}.}}
+
:* {{ltt|cpp/io/ios_base/iostate|eofbit}} または {{ltt|cpp/io/ios_base/iostate|badbit}} {{tt|failbit}} failbit {{l2tt|cpp/io/ios_base/failure}}
* {{tr|Sentryは{{c|false}}を返されるか歩哨のコンストラクタが例外をスローした場合:a|If the sentry returned {{c|false}} or sentry's constructor threw an exception:}}
+
:* tie()
:* {{tr|ゼロへの入力ストリームで抽出された文字数(gcount)を設定します|sets the number of extracted characters (gcount) in the input stream to zero}}
+
* {{tt|sentry::operator bool()}} sentry {{l2tt|cpp/io/basic_ios/good}}
:* {{tr|関数は{{tt|CharT}}の配列に書き込むために呼び出された場合、配列の最初の場所に{{tt|CharT()}}(ヌル文字)を書き込みます|if the function was called to write to an array of {{tt|CharT}}, writes {{tt|CharT()}} (the null character) to the first location of the array}}
+
* sentry {{c|false}} sentry
* {{tr|Sentryは{{c|true}}返された場合は、入力が実行されます|If the sentry returned {{c|true}}, performs the input}}
+
:* (gcount)
:* {{tr|例外は、入力中に投げられたときに、入力ストリームで{{tt|badbit}}を設定します。 badbitを上の例外がこのストリームの例外マスクで有効になっている場合は、例外もスローされ.|if an exception is thrown during input, sets {{tt|badbit}} in the input stream. If exceptions on badbit are enabled in this stream's exception mask, the exception is also rethrown.}}
+
:* {{tt|CharT}} {{tt|CharT()}}
:* {{tr|例外は、入力時に送出されなかった場合は、入力ストリーム内の抽出された文字数(gcount)を設定します.|If no exception was thrown during input, sets the number of extracted characters (gcount) in the input stream.}}
+
{{|}} {{|()}} ()}}
* {{tr|いずれにしても、例外によって終了したり返したりするかどうか、見張りのデストラクタは、この関数を離れる前に呼ばれ.|In any event, whether terminating by exception or returning, the sentry's destructor is called before leaving this function.}}
+
* {{|{{c|}} {{c|}} {{|{{|}}
 +
{{tt|badbit}} badbit
 +
:* (gcount)
 +
* sentry
  
 
===標準ライブラリ===
 
===標準ライブラリ===
{{tr|次のような標準ライブラリ関数は{{concept|UnformattedInputFunction}}sです.|The following standard library functions are {{concept|UnformattedInputFunction}}s.}}
 
  
* {{tr|{{lc|std::getline}}ことを除いて、それはgcountを変更しません.|{{lc|std::getline}}, except that it does not modify gcount.}}
+
{{|}}
 +
 
 +
{{lc|std::getline}} gcount
 
* {{l2tt|cpp/io/basic_istream/operator_gtgt|operator>>{{dsc small|(basic_streambuf*)}}}}
 
* {{l2tt|cpp/io/basic_istream/operator_gtgt|operator>>{{dsc small|(basic_streambuf*)}}}}
 
* {{l2tt|cpp/io/basic_istream/get}}
 
* {{l2tt|cpp/io/basic_istream/get}}
29行: 31行:
 
* {{l2tt|cpp/io/basic_istream/read}}
 
* {{l2tt|cpp/io/basic_istream/read}}
 
* {{l2tt|cpp/io/basic_istream/readsome}}
 
* {{l2tt|cpp/io/basic_istream/readsome}}
* {{tr|{{l2tt|cpp/io/basic_istream/putback}}、それは最初{{tt|eofbit}}をクリアすることを除いて|{{l2tt|cpp/io/basic_istream/putback}}, except that it first clears {{tt|eofbit}}}}
+
* {{l2tt|cpp/io/basic_istream/putback}} {{tt|eofbit}}
* {{tr|{{l2tt|cpp/io/basic_istream/unget}}、それは最初{{tt|eofbit}}をクリアすることを除いて|{{l2tt|cpp/io/basic_istream/unget}}, except that it first clears {{tt|eofbit}}}}
+
* {{l2tt|cpp/io/basic_istream/unget}} {{tt|eofbit}}
* {{tr|{{l2tt|cpp/io/basic_istream/sync}}ことを除いて、それはgcountを変更しません|{{l2tt|cpp/io/basic_istream/sync}}, except that it does not modify gcount}}
+
* {{l2tt|cpp/io/basic_istream/sync}} gcount
* {{tr|{{l2tt|cpp/io/basic_istream/tellg}}ことを除いて、それはgcountを変更しません|{{l2tt|cpp/io/basic_istream/tellg}}, except that it does not modify gcount}}
+
* {{l2tt|cpp/io/basic_istream/tellg}} gcount
* {{tr|{{l2tt|cpp/io/basic_istream/seekg}}ことを除いて、それは最初{{tt|eofbit}}をクリアしgcountを変更しません|{{l2tt|cpp/io/basic_istream/seekg}}, except that it first clears {{tt|eofbit}} and does not modify gcount}}
+
* {{l2tt|cpp/io/basic_istream/seekg}} {{tt|eofbit}} gcount
* {{tr|{{lc|std::ws}}ことを除いて、それはgcountを変更しません|{{lc|std::ws}}, except that it does not modify gcount}}
+
* {{lc|std::ws}} gcount
  
[[de:cpp/concept/UnformattedInputFunction]]
+
[[de:cpp//UnformattedInputFunction]]
[[en:cpp/concept/UnformattedInputFunction]]
+
[[en:cpp//UnformattedInputFunction]]
[[es:cpp/concept/UnformattedInputFunction]]
+
[[es:cpp//UnformattedInputFunction]]
[[fr:cpp/concept/UnformattedInputFunction]]
+
[[fr:cpp//UnformattedInputFunction]]
[[it:cpp/concept/UnformattedInputFunction]]
+
[[it:cpp//UnformattedInputFunction]]
[[pt:cpp/concept/UnformattedInputFunction]]
+
[[pt:cpp//UnformattedInputFunction]]
[[ru:cpp/concept/UnformattedInputFunction]]
+
[[ru:cpp//UnformattedInputFunction]]
[[zh:cpp/concept/UnformattedInputFunction]]
+
[[zh:cpp//UnformattedInputFunction]]

2018年6月20日 (水) 06:43時点における最新版

 
 
名前付き要件
基本
型の性質
ライブラリ全体
コンテナ
コンテナの要素
イテレータ
ストリーム入出力
UnformattedInputFunction
乱数
並行処理
(C++11)

(C++11)
(C++11)
その他
 

[編集] 要件

UnformattedInputFunction は以下の動作を行うストリーム入力関数です。

  • 自動記憶域期間を持つ basic_istream::sentry 型のオブジェクトを noskipws 引数を true に設定して構築します。 これは以下の動作を行います。
  • 入力ストリームに eofbit または badbit がセットされている場合、 failbit も同様にセットし、さらに、この入力ストリームの例外マスクで failbit に対する例外が有効な場合、 ios_base::failure を投げます。
  • 適用可能であれば、 tie() されている出力ストリームをフラッシュします。
  • sentry::operator bool() を呼ぶことによって sentry オブジェクトの状態を確認します。 これは basic_ios::good と同等です。
  • sentry が false を返した場合、または sentry のコンストラクタが例外を投げた場合、
  • 入力ストリームの抽出された文字数 (gcount) をゼロに設定します。
  • 関数が CharT の配列に書き込むために呼ばれた場合、その配列の最初の位置に CharT() (ヌル文字) を書き込みます。
  • sentry が true を返した場合、 rdbuf()->sbumpc() または rdbuf()->sgetc() を呼んだかのように入力を行います。
  • ストリームの終端に達した (rdbuf()->sbumpc() または rdbuf()->sgetc()Traits::eof() を返した) 場合、 eofbit をセットします。 この入力ストリームの例外マスクで eofbit に対する例外が有効な場合、 ios_base::failure を投げます。
  • 入力中に例外が投げられた場合、入力ストリームに badbit をセットします。 この入力ストリームの例外マスクで badbit に対する例外が有効な場合、その例外が投げ直されます。
  • 入力中に例外が投げられなかった場合、入力ストリームの抽出された文字数 (gcount) を設定します。
  • いかなる出来事が発生しても、例外によって終了したか戻ったかにかかわらず、この関数を抜ける前に sentry のデストラクタが呼ばれます。

[編集] 標準ライブラリ

以下の標準ライブラリの関数は UnformattedInputFunction です。