Added basic_ios abstraction and finished cout/cerr implementation.
basic_ios was missing. we should have:
ostream -> basic_ios -> ios_base
basic_ios's role is very minor for us, it just holds the streambuf where the
writes happen. In a real STL it does a bit more, it deals with the numerous
flags that can be set on a stream.
The ostream implementation is now complete since it can get
the streambuf from its base class to perform the 2 ops supported:
- flush()
- operator<<(char*)
The final piece was a concrete implementation of a streambuf to output the strings
to stdout or stderr.
This is done in a new class stdio_filebuf which wraps a regular stdio.h stream.
For cerr we use stderr to build the stdio_filebuf instance that cerr will wrap.
Same for cout and stdout.
14 files changed