b01bd93a20
Add the following classes in the 'simgear' namespace: - CharArrayStreambuf subclass of std::streambuf stream buffer - ROCharArrayStreambuf subclass of CharArrayStreambuf stream buffer - CharArrayIStream subclass of std::istream input stream - CharArrayOStream subclass of std::ostream output stream - CharArrayIOStream subclass of std::iostream input/output stream CharArrayStreambuf is a stream buffer class allowing to read from, and write to char arrays (std::strstream has been deprecated since C++98). Contrary to std::strstream, this class does no dynamic allocation: it is very simple, strictly staying for both reads and writes within the limits of the buffer specified in the constructor. Contrary to std::stringstream, CharArrayStreambuf allows one to work on an array of char (that could be static data or on the stack) without having to make a whole copy of it. CharArrayStreambuf supports reading and writing (including efficient implementations of xsgetn() and xsputn()), seeking (with independent read and write stream pointers, as for std::stringstream) and putting back chars up to the beginning of the char array. The internal buffer for both reads and writes is defined to be the whole buffer specified in the constructor call. As a consequence, flushing the stream buffer with pubsync() is useless: data is always written directly to the buffer passed to the constructor, never to an intermediate buffer. Of course, this buffer must remain available as long as the stream buffer object is used. ROCharArrayStreambuf is a read-only subclass of CharArrayStreambuf. CharArrayIStream, CharArrayOStream and CharArrayIOStream are very simple convenience stream classes using either CharArrayStreambuf or ROCharArrayStreambuf as their stream buffer class. |
||
---|---|---|
.. | ||
bucket | ||
bvh | ||
canvas | ||
debug | ||
environment | ||
ephemeris | ||
hla | ||
io | ||
magvar | ||
math | ||
misc | ||
nasal | ||
package | ||
props | ||
scene | ||
screen | ||
serial | ||
sound | ||
structure | ||
threads | ||
timing | ||
xml | ||
.gitignore | ||
CMakeLists.txt | ||
compiler.h | ||
constants.h | ||
sg_inlines.h | ||
simgear_config_cmake.h.in | ||
version.h.in |