diff options
author | Nico Weber <nicolasweber@gmx.de> | 2013-04-09 04:19:27 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2013-04-09 04:19:27 (GMT) |
commit | a95b0819703aefc6a4f74004d6639f2cebd1e5d2 (patch) | |
tree | 2e3aba171219da51db1ec822013cbb54a51035e4 /src/line_printer.h | |
parent | f872a912c57879767a7715094790aa4380badce2 (diff) | |
download | Ninja-a95b0819703aefc6a4f74004d6639f2cebd1e5d2.zip Ninja-a95b0819703aefc6a4f74004d6639f2cebd1e5d2.tar.gz Ninja-a95b0819703aefc6a4f74004d6639f2cebd1e5d2.tar.bz2 |
Make LinePrinter members private, add comments.
Diffstat (limited to 'src/line_printer.h')
-rw-r--r-- | src/line_printer.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/line_printer.h b/src/line_printer.h index b3cb163..78510ea 100644 --- a/src/line_printer.h +++ b/src/line_printer.h @@ -17,22 +17,31 @@ #include <string> +/// Prints lines of text, possibly overprinting previously printed lines +/// if the terminal supports it. class LinePrinter { public: LinePrinter(); + bool is_smart_terminal() const { return smart_terminal_; } + void set_smart_terminal(bool smart) { smart_terminal_ = smart; } + enum LineType { FULL, SHORT }; + /// Overprints the current line. If type is SHORT, elides to_print to fit on + /// one line. void Print(std::string to_print, LineType type); + /// Prints a string on a new line, not overprinting previous output. void PrintOnNewLine(const std::string& to_print); - //private: + private: /// Whether we can do fancy terminal control codes. bool smart_terminal_; + /// Whether the caret is at the beginning of a blank line. bool have_blank_line_; }; |