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
25
26namespace cuttlefish {
27
33 std::string output;
36};
37
54 public:
58 LogMonitorDisplay(size_t width);
59
60 /* Draw the output of a single monitor source. */
61 void DrawReport(MonitorSource*, size_t lines);
62 void DrawReport(MonitorOutput, size_t lines);
63
69
70 private:
75
81 void FormatAndDrawLine(std::string_view formatted);
82
83 size_t width_;
84 std::stringstream ss_;
87};
88
89} // namespace cuttlefish
Definition: display.h:53
LogMonitorDisplayResult Finalize()
Definition: display.cc:59
void FormatAndDrawLine(std::string_view formatted)
Definition: display.cc:90
std::stringstream ss_
Definition: display.h:84
LogMonitorDisplay(size_t width)
Definition: display.cc:40
bool colorize_
Definition: display.h:86
int total_lines_drawn_
Definition: display.h:85
size_t width_
Definition: display.h:83
void DrawBorderedText(const MonitorOutput &)
Definition: display.cc:69
void DrawReport(MonitorSource *, size_t lines)
Definition: display.cc:43
Definition: monitor_source.h:36
Definition: alloc_driver.h:20
Definition: display.h:31
std::string output
Definition: display.h:33
int total_lines_drawn
Definition: display.h:35
Definition: monitor_source.h:28