std::basic_streambuf::sputn, std::basic_streambuf::xsputn
提供:cppreference.com
< cpp | io | basic streambuf
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| std::streamsize sputn( const char_type* s, std::streamsize count ); |
(1) | |
| protected: virtual std::streamsize xsputn( const char_type* s, std::streamsize count ); |
(2) | |
最派生クラスの
2) xsputn(s, count)呼び出し.Original:
Calls
xsputn(s, count) of the most derived class.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.
最初の要素が
countによって指された文字配列から出力シーケンスにs文字を書き込みます。文字がsputc()を繰り返し呼び出したかのように書かれています。どちらcount文字が書き込まれたときに書き込みが停止またはsputc()への呼び出しがtraits::eof()返したでしょう.Original:
Writes
count characters to the output sequence from the character array whose first element is pointed to by s. The characters are written as if by repeated calls to sputc(). Writing stops when either count characters are written or a call to sputc() would have returned traits::eof().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.
put領域が(pptr()==epptr())いっぱいになった場合、この関数は
overflow()に電話をかけるか、またはいくつかの他、不特定で呼び出しoverflow()の効果を達成することができる、意味.Original:
If the put area becomes full (pptr()==epptr()), this function may call
overflow(), or achieve the effect of calling overflow() by some other, unspecified, means.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:
(none)
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:
The number of characters successfully written.
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.
[編集] 例
#include <iostream> #include <sstream> int main() { std::ostringstream s1; std::streamsize sz = s1.rdbuf()->sputn("This is a test", 14); s1 << '\n'; std::cout << "The call to sputn() returned " << sz << '\n' << "The output sequence contains " << s1.str(); std::istringstream s2; sz = s2.rdbuf()->sputn("This is a test", 14); std::cout << "The call to sputn() on an input stream returned " << sz << '\n'; }
Output:
The call to sputn() returned 14 The output sequence contains This is a test The call to sputn() on an input stream returned 0
[編集] も参照してください
| xsgetn()を呼び出します Original: invokes xsgetn() The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |