Android-cuttlefish cvd tool
display.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2026 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <stddef.h>
20
21#include <sstream>
22#include <string>
23
24#include "absl/strings/string_view.h"
25
27
28namespace cuttlefish {
29
35 std::string output;
38};
39
56 public:
60 LogMonitorDisplay(size_t width);
61
62 /* Draw the output of a single monitor source. */
63 void DrawReport(MonitorSource*, size_t lines);
64 void DrawReport(MonitorOutput, size_t lines);
65
71
72 private:
77
83 void FormatAndDrawLine(absl::string_view formatted);
84
85 size_t width_;
86 std::stringstream ss_;
89};
90
91} // namespace cuttlefish
Definition: display.h:55
LogMonitorDisplayResult Finalize()
Definition: display.cc:59
std::stringstream ss_
Definition: display.h:86
LogMonitorDisplay(size_t width)
Definition: display.cc:40
bool colorize_
Definition: display.h:88
int total_lines_drawn_
Definition: display.h:87
size_t width_
Definition: display.h:85
void DrawBorderedText(const MonitorOutput &)
Definition: display.cc:69
void FormatAndDrawLine(absl::string_view formatted)
Definition: display.cc:90
void DrawReport(MonitorSource *, size_t lines)
Definition: display.cc:43
Definition: monitor_source.h:36
Definition: alloc_driver.h:21
Definition: display.h:33
std::string output
Definition: display.h:35
int total_lines_drawn
Definition: display.h:37
Definition: monitor_source.h:28