Multi virtual terminal streams library for c++
This library needs ncurses with wide-character support. On Ubuntu 16.04, install
libncursesw using sudo apt-get install libncursesw5-dev
.
mkdir build && cd build && cmake .. && make -j4
Streamflood allows you to have multiple panes within the terminal running your program. The panes can have a fixed size or be relative to the window size. Within your program, you choose to output text streams to any of these panes. The library takes care of layouting them in a way that the pane will fit on your screen.
In this example, there are four panes, of which three fits in one window:
By pressing "0", you go the corresponding window, containing the last pane:
By resizing the window to be bigger, it can display all panes at the same time:
You can check out the example
for info on how to use the code. Briefly, you instantiate a streamflood::Streams
object,
add a new stream by specifying its name and dimensions, streams.add_stream("stream0", 50, 200)
and finally write to the stream streams["stream0"] << "Writing to stream0!"
.