1
0
forked from Alepha/Alepha

8 Commits

Author SHA1 Message Date
1a6460e717 Stackable streambufs have a depth observer now. 2024-04-04 22:29:23 -04:00
cc1fdf725b Correct some of the underlying-forwarding parts of stream stacks. 2024-04-03 23:38:13 -04:00
83034c501f AutoRAII based stream adaptors. 2024-04-03 16:28:55 -04:00
8bd9852bd4 Fix forwarding the messages to the underlying functions.
If you take the address of the overriding function, it cannot be
converted to the base class.  So for all the "forward to underlying"
set I have to make a base class with no overrides which forwards.

Then the main stackable class can make any overrides it wants.  I
believe that this is still safe, since the base class knows the name
to be virtual.  So we're not taking the address of the impl function,
but instead taking the index of the virtual function.  If I'm
wrong... I'll need a whole different approach here.
2024-04-03 15:50:31 -04:00
d8689b85e8 Make the underlying streambuf private in stacks. 2024-04-03 15:01:52 -04:00
7410245314 Input stream stacking with line numbers!
This should help when building custom language parsers.  An input
stream can be augmented with this stackable streambuf to track
the current line number.  This can (and should) be done low in
the stack, so that any variable expansion and comment stripping
stages will not affect line number count.

The stage bolts on a stream state sidecar to point back to itself.
The observer for the current line peeks into the sidecar to see
the current line number tracking object for the stream and then
gets the current line number from that object.

The line number is the current line the input cursor is on.
Newline characters are treated as-if they're part of the current
line.  The newly created line will start on the first character
after the newline character.  This helps keep line-index counts
accurate too.  (Idea for a further stage?  Line index cursor
too?)
2024-04-03 08:29:10 -04:00
373b07e1c4 Apply the newer namespace rules and layout/formatting. 2024-04-02 23:32:02 -04:00
db70cb3b08 Relocate StackableStreambuf to IOStreams. 2023-11-10 13:30:08 -05:00