Android-cuttlefish cvd tool
|
#include <line_printer.h>
Public Types | |
enum | LineType { INFO , WARNING , ERROR } |
Public Member Functions | |
LinePrinter () | |
bool | is_smart_terminal () const |
void | set_smart_terminal (bool smart) |
void | Print (std::string to_print, LineType type) |
void | KeepInfoLine () |
If there's an INFO line, keep it. If not, do nothing. More... | |
Public Attributes | |
bool | quiet_ = false |
Private Attributes | |
bool | smart_terminal_ |
Whether we can do fancy terminal control codes. More... | |
bool | have_blank_line_ |
Whether the caret is at the beginning of a blank line. More... | |
std::string | info_line_ |
The last printed info line when printing to a dumb terminal. More... | |
Prints lines of text, possibly overprinting previously printed lines if the terminal supports it.
LinePrinter::LinePrinter | ( | ) |
|
inline |
void LinePrinter::KeepInfoLine | ( | ) |
If there's an INFO line, keep it. If not, do nothing.
void LinePrinter::Print | ( | std::string | to_print, |
LineType | type | ||
) |
Outputs the given line. INFO output will be overwritten. WARNING and ERROR appear on a line to themselves.
|
inline |
|
private |
Whether the caret is at the beginning of a blank line.
|
private |
The last printed info line when printing to a dumb terminal.
bool LinePrinter::quiet_ = false |
|
private |
Whether we can do fancy terminal control codes.