Ninja
|
Prints lines of text, possibly overprinting previously printed lines if the terminal supports it. More...
#include <line_printer.h>
Public Types | |
enum | LineType { FULL, ELIDE } |
Public Member Functions | |
bool | is_smart_terminal () const |
LinePrinter () | |
void | Print (string to_print, LineType type) |
Overprints the current line. More... | |
void | PrintOnNewLine (const string &to_print) |
Prints a string on a new line, not overprinting previous output. More... | |
void | set_smart_terminal (bool smart) |
Private Attributes | |
bool | have_blank_line_ |
Whether the caret is at the beginning of a blank line. More... | |
bool | smart_terminal_ |
Whether we can do fancy terminal control codes. More... | |
Prints lines of text, possibly overprinting previously printed lines if the terminal supports it.
Definition at line 23 of file line_printer.h.
Enumerator | |
---|---|
FULL | |
ELIDE |
Definition at line 29 of file line_printer.h.
LinePrinter::LinePrinter | ( | ) |
Definition at line 29 of file line_printer.cc.
References smart_terminal_.
|
inline |
Definition at line 26 of file line_printer.h.
Referenced by BuildStatus::BuildEdgeFinished().
void LinePrinter::Print | ( | string | to_print, |
LineType | type | ||
) |
Overprints the current line.
If type is ELIDE, elides to_print to fit on one line.
Definition at line 45 of file line_printer.cc.
References ELIDE, ElideMiddle(), have_blank_line_, and smart_terminal_.
Referenced by LaconicPrinter::OnTestStart(), and BuildStatus::PrintStatus().
void LinePrinter::PrintOnNewLine | ( | const string & | to_print | ) |
Prints a string on a new line, not overprinting previous output.
Definition at line 104 of file line_printer.cc.
References have_blank_line_.
Referenced by BuildStatus::BuildEdgeFinished(), BuildStatus::BuildFinished(), LaconicPrinter::OnTestPartResult(), and LaconicPrinter::OnTestProgramEnd().
|
inline |
Definition at line 27 of file line_printer.h.
Referenced by BuildStatus::BuildStatus().
|
private |
Whether the caret is at the beginning of a blank line.
Definition at line 45 of file line_printer.h.
Referenced by Print(), and PrintOnNewLine().
|
private |
Whether we can do fancy terminal control codes.
Definition at line 42 of file line_printer.h.
Referenced by LinePrinter(), and Print().