std::basic_...buf::xsgetn(3)
π
std::basic_...buf::xsgetn(3) π
okay so welcome to the C++ Standard Libary page, bestie β yes thatβs the manual name, and weβre talking about the std::basic_streambuf girlies today. π
β¨ NAME β¨
The name line is literally std::basic_streambuf::sgetn,std::basic_streambuf::xsgetn β dash β and then it says it again: std::basic_streambuf::sgetn,std::basic_streambuf::xsgetn. No cap, itβs just built like that. π
πΈ Synopsis πΈ
std::streamsize sgetn( char_type* s, std::streamsize count );
(1)
protected:
virtual std::streamsize xsgetn( char_type* s, std::streamsize count
);
(2)
- Calls
xsgetn(s, count)of the most derived class. - Reads
countcharacters from the input sequence and stores them into a character array pointed to bys. The characters are read as if by repeated calls tosbumpc(). That is, if less thancountcharacters are immediately available, the function callsuflow()to provide more untilTraits::eof()is returned. Classes derived fromstd::basic_streambufare permitted to provide more efficient implementations of this function.
π§Έ Parameters π§Έ
sβ pointer to the beginning of achar_typearraycountβ maximum number of characters to read.
π Return value π
The number of characters successfully read. If it is less than count the input sequence has reached the end.
π§ Notes π§
The rule about βmore efficient implementationsβ permits bulk I/O without intermediate buffering: thatβs how std::ifstream::read simply passes the pointer to the POSIX read() system call in some implementations of iostreams.
π Example π
This section is incomplete Reason: no example
π See also π
sputninvokesxsputn()(public member function)
π·οΈ Category π·οΈ
Todo no example
xoxo, your Unix-literate bestie π β source: http://cppreference.com, version/date: 2024.06.10, page: std::basic_...buf::xsgetn(3). π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms