Android-cuttlefish cvd tool
ansi_codes.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 <string>
20#include <string_view>
21
22namespace cuttlefish {
23
24inline constexpr std::string_view kAnsiCursorTopLeft = "\033[;H";
25inline constexpr std::string_view kAnsiBoldBlue = "\033[1;34m";
26inline constexpr std::string_view kAnsiBoldCyan = "\033[1;36m";
27inline constexpr std::string_view kAnsiClearScreen = "\033[2J";
28inline constexpr std::string_view kAnsiClearScreenAfterCursor = "\033[J";
29inline constexpr std::string_view kAnsiCsi = "\033[";
30inline constexpr std::string_view kAnsiCyan = "\033[0;36m";
31inline constexpr std::string_view kAnsiGreen = "\033[0;32m";
32inline constexpr std::string_view kAnsiGrey = "\033[90m";
33inline constexpr std::string_view kAnsiRed = "\033[0;31m";
34inline constexpr std::string_view kAnsiReset = "\033[0m";
35inline constexpr std::string_view kAnsiWhite = "\033[0;37m";
36inline constexpr std::string_view kAnsiYellow = "\033[0;33m";
37inline constexpr std::string_view kXtermUseAlternateScreen = "\033[?1049h";
38inline constexpr std::string_view kXtermUseMainScreen = "\033[?1049l";
39
40// CSI final bytes are in the range 0x40–0x7E (ASCII @ to ~).
41bool IsCsiFinalByte(char c);
42
43std::string AnsiCursorUp(int n);
44
45} // namespace cuttlefish
struct f2fs_configuration c
Definition: libf2fs_io.c:47
Definition: alloc_driver.h:20
bool IsCsiFinalByte(char c)
Definition: ansi_codes.cc:25
constexpr std::string_view kAnsiYellow
Definition: ansi_codes.h:36
constexpr std::string_view kAnsiCyan
Definition: ansi_codes.h:30
constexpr std::string_view kAnsiCsi
Definition: ansi_codes.h:29
constexpr std::string_view kAnsiCursorTopLeft
Definition: ansi_codes.h:24
std::string AnsiCursorUp(int n)
Definition: ansi_codes.cc:30
constexpr std::string_view kAnsiGrey
Definition: ansi_codes.h:32
constexpr std::string_view kAnsiWhite
Definition: ansi_codes.h:35
constexpr std::string_view kAnsiClearScreen
Definition: ansi_codes.h:27
constexpr std::string_view kAnsiBoldCyan
Definition: ansi_codes.h:26
constexpr std::string_view kXtermUseMainScreen
Definition: ansi_codes.h:38
constexpr std::string_view kAnsiClearScreenAfterCursor
Definition: ansi_codes.h:28
constexpr std::string_view kAnsiBoldBlue
Definition: ansi_codes.h:25
constexpr std::string_view kAnsiReset
Definition: ansi_codes.h:34
constexpr std::string_view kAnsiRed
Definition: ansi_codes.h:33
constexpr std::string_view kAnsiGreen
Definition: ansi_codes.h:31
constexpr std::string_view kXtermUseAlternateScreen
Definition: ansi_codes.h:37