service interface stream enhancements #93
I made some more improvements:
- Printout can be redirected to stderr now optionally (can be used on host environments)
- printChar takes additional boolean to specify where to print (stderr or stdout)
- if stderr is used, mode is unbuffered. Preamble must be printed manually then, new getter function for this
- forward declaration of ServiceINterfaceStreams so the public functions (setActive(), getPreamble()) can be used. otherwise, they can only be used in main().
- some simplifications and better documentation.
I have rewritten parts of the code.
The only external definitions are the classes itself now (which are already std::ostream's anyway). These can be instantiated somewhere else, and the extra osstreams are not necessary anymore.
I reworked the getPreamble() function to not use dnymaic memory allocation (at runtime), so sprintf is used again.
THere are optional flags to work in unbuffered mode or pipe output to stderr instead of stdout as well.
Small API change: printChar now takes a second parameter, which specifies whether to use stderr or stdout. Can be used on linux for example.
Old implementation was using dynamic memory allocaton, space for std::string now allocated at initialization only.
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?