Android-cuttlefish cvd tool
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
LinePrinter Struct Reference

#include <line_printer.h>

Collaboration diagram for LinePrinter:
Collaboration graph
[legend]

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...
 

Detailed Description

Prints lines of text, possibly overprinting previously printed lines if the terminal supports it.

Member Enumeration Documentation

◆ LineType

Enumerator
INFO 
WARNING 
ERROR 

Constructor & Destructor Documentation

◆ LinePrinter()

LinePrinter::LinePrinter ( )

Member Function Documentation

◆ is_smart_terminal()

bool LinePrinter::is_smart_terminal ( ) const
inline

◆ KeepInfoLine()

void LinePrinter::KeepInfoLine ( )

If there's an INFO line, keep it. If not, do nothing.

◆ Print()

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.

◆ set_smart_terminal()

void LinePrinter::set_smart_terminal ( bool  smart)
inline

Member Data Documentation

◆ have_blank_line_

bool LinePrinter::have_blank_line_
private

Whether the caret is at the beginning of a blank line.

◆ info_line_

std::string LinePrinter::info_line_
private

The last printed info line when printing to a dumb terminal.

◆ quiet_

bool LinePrinter::quiet_ = false

◆ smart_terminal_

bool LinePrinter::smart_terminal_
private

Whether we can do fancy terminal control codes.


The documentation for this struct was generated from the following files: