Android-cuttlefish cvd tool
line_printer.h
Go to the documentation of this file.
1// Copyright 2013 Google Inc. All Rights Reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef NINJA_LINE_PRINTER_H_
16#define NINJA_LINE_PRINTER_H_
17
18#include <stddef.h>
19#include <string>
20
25
26 bool is_smart_terminal() const { return smart_terminal_; }
27 void set_smart_terminal(bool smart) { smart_terminal_ = smart; }
28
29 bool quiet_ = false;
30
32
35 void Print(std::string to_print, LineType type);
36
38 void KeepInfoLine();
39
40 private:
43
46
48 std::string info_line_;
49
50#ifdef _WIN32
51 void* console_;
52#endif
53};
54
55#endif // NINJA_LINE_PRINTER_H_
uint8_t type
Definition: pairing_connection.h:0
Definition: line_printer.h:23
LinePrinter()
Definition: line_printer.cpp:48
void set_smart_terminal(bool smart)
Definition: line_printer.h:27
bool smart_terminal_
Whether we can do fancy terminal control codes.
Definition: line_printer.h:42
void Print(std::string to_print, LineType type)
Definition: line_printer.cpp:70
bool have_blank_line_
Whether the caret is at the beginning of a blank line.
Definition: line_printer.h:45
LineType
Definition: line_printer.h:31
@ ERROR
Definition: line_printer.h:31
@ WARNING
Definition: line_printer.h:31
@ INFO
Definition: line_printer.h:31
bool is_smart_terminal() const
Definition: line_printer.h:26
void KeepInfoLine()
If there's an INFO line, keep it. If not, do nothing.
Definition: line_printer.cpp:133
std::string info_line_
The last printed info line when printing to a dumb terminal.
Definition: line_printer.h:48
bool quiet_
Definition: line_printer.h:29