The user who asked the following question accepted "read buffer" pretty fast: What does rd stand for in rdstate and rdbuf?
I still wonder what "read buffer" would mean in the context of "std::ostream" (cout). I did not find ANY STL documentation describing this function as doing any "reading". Is that just a misnamed function? (...apparently, but maybe I am missing something)
I still wonder what "read buffer" would mean in the context of "std::ostream" (cout).
It's "read" as in "read the value of" or "get the value of" not read as in "read from the stream".
It seems to be a common convention in the old Cfront code, e.g. see the Task library described in the Cfront 2.0 documentation which has several functions named like that, e.g. on page 2-5:
int rdcount();
int rdmode();
int rdmax();
void setmode(int);
void setmax(int);
So "rd" and "set" seem to be used for names of getters and setters respectively.
That means the overload of rdbuf(basic_streambuf<C,T>*)
that replaces the streambuf is misnamed, it should be setbuf
, but that name is already used by the streambuf itself with a different meaning. That rdbuf
"setter" overload was added later, the original design only had the "getter", as shown in the STRSTREAM(3C++) manual page at the end of the PDF linked to above:
class strstream : public strstreambase, public iostream {
public:
strstream();
strstream(char*, int, int mode);
strstreambuf* rdbuf() ;
char* str();
};
Raw Device/Data Buffer (rdbuf) <---- I prefer @Daniel Jour's comments.
like: explicit basic_istream( std::basic_streambuf* sb); reference:
class basic_streambuf is an Abstraction of Raw Device. that means it may socket, file, namedpipe, mailslot, memory, graphycard-mem. so from high level, how to name the different devices?
I think both RD(raw device) and raw data are ok, but raw device more accurate, even 99.999% times it points to a memory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With