streambuf::xsputn | virtual protected member function |
streamsize xsputn ( const char * s, streamsize n ); |
Write sequence of characters
Writes up to n characters from the array pointed by s to the output sequence controlled by the stream buffer.
If less than n characters can be written to the output sequence the function stops and leaves the put pointer pptr in the same state as if successive calls to sputc were made until an EOF (or traits::eof() for other traits) was returned.
This is a virtual member function that can be redefined for a specific behavior in derived classes. Its default behavior in streambuf is to perform the expected behavior by calling repeatedly the member function sputc, but this may be overriden for more efficient implementations in derived classes (neither filebuf nor stringbuf do, though).
Parameters
- s
- Pointer to the sequence of characters to be output.
- n
- Number of character to be put. This is an integer value of type streamsize.
Return Value
The number of characters written, returned as a value of type streamsize.Basic template member declaration
( basic_streambuf<charT,traits> )typedef charT char_type; streamsize xsputn (const char_type * s, streamsize n); |
See also
streambuf::sputn | Write a sequence of characters (public member function) |