diff options
author | Andrew Gallant <jamslam@gmail.com> | 2018-06-23 20:16:00 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2018-06-23 20:49:05 -0400 |
commit | d5139228e5787b9ec0ea8209e64d3b878ab72309 (patch) | |
tree | 02232843615bd3514e1dce8fda67f9b735cb7fc4 /src | |
parent | bb16ba6311c13369e85b7246380acc9960b52833 (diff) |
termcolor: add BufferedStandardStream
This commit adds a new type, BufferedStandardStream, which emulates the
StandardStream API (sans `lock`), but will internally use a buffered
writer.
To achieve this, we add a new default method to the WriteColor trait that
indicates whether the underlying writer must synchronously communicate
with an API to control coloring (e.g., the Windows console API). The new
BufferedStandardStream then uses this default method to determine how
eager it should be to flush its buffer before employing color settings.
This should have basically zero overhead when using ANSI color escape
sequences.
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions