Hi,
I discovered an undocumented Stream base class used in Simon Ford's TextLCD.
A couple of comments:
1) Why isn't it documented ?
2) the Stream base considers that any stream should be bidirectional. This is plain wrong. TextLCD is the first counter example.
I would suggest providing an InputStream and an OutputStream class. A bidirectional Stream class can still be provided by composition of those two. A template could also be provided to allow the combination of an input and an output stream (say combine a TextLCD and a Keyboard to form a full bidirectional stream).
3) for output, Stream interface only requires a _putc function. This is relatively limitative in terms of performance.
A _puts function would be a nice addition. A default implementation would give support to those devices where there is nothing else to be done than loop over the string.
My 2 cents,
Olivier
Hi,
I discovered an undocumented Stream base class used in Simon Ford's TextLCD.
A couple of comments:
1) Why isn't it documented ?
2) the Stream base considers that any stream should be bidirectional. This is plain wrong. TextLCD is the first counter example. I would suggest providing an InputStream and an OutputStream class. A bidirectional Stream class can still be provided by composition of those two. A template could also be provided to allow the combination of an input and an output stream (say combine a TextLCD and a Keyboard to form a full bidirectional stream).
3) for output, Stream interface only requires a _putc function. This is relatively limitative in terms of performance. A _puts function would be a nice addition. A default implementation would give support to those devices where there is nothing else to be done than loop over the string.
My 2 cents,
Olivier