std::basic_streambuf::sputn, std::basic_streambuf::xsputn — cppreference.com
De cppreference.com
<metanoindex/>
<tbody> </tbody>
|
|
(1) | |
|
|
(2) | |
1)
Appels xsputn(s, count) de la classe la plus dérivée .
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.
2)
Écrit caractères count à la séquence de sortie du tableau de caractères dont le premier élément est pointé par s. Les caractères sont écrits comme par des appels répétés à sputc(). L'écriture s'arrête lorsque l'un des personnages sont écrits count ou un appel à sputc() aurait retourné 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.
Si la zone est pleine mise (pptr()==epptr()), cette fonction peut appeler overflow(), ou obtenir l'effet de overflow() appelant par un autre, sans précision, signifie .
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.
Paramètres
(Aucun)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Retourne la valeur
Le nombre de caractères écrites avec succès .
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.
Exemple
#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'; }
Résultat :
The call to sputn() returned 14 The output sequence contains This is a test The call to sputn() on an input stream returned 0
Voir aussi
Invoque Original: invokes The text has been machine-translated via Google Translate. (fonction membre publique) [edit] | |