1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00
VILLASnode/common/include/villas/boxes.hpp
Steffen Vogel 7d10544d79 Apply clang-format changes
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00

51 lines
2.1 KiB
C++

/* Various helper functions.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
// The suffixed of the BOX_ macro a constructed by
// combining the following letters in the written order:
// - U for a line facing upwards
// - D for a line facing downwards
// - L for a line facing leftwards
// - R for a line facing rightwards
//
// E.g. a cross can be constructed by combining all line fragments:
// BOX_UDLR
#if 0 // Alternate character set
#define BOX(chr) "\e(0" chr "\e(B"
#define BOX_LR BOX("\x71") // Boxdrawing: ─
#define BOX_UD BOX("\x78") // Boxdrawing: │
#define BOX_UDR BOX("\x74") // Boxdrawing: ├
#define BOX_UDLR BOX("\x6E") // Boxdrawing: ┼
#define BOX_UDL BOX("\x75") // Boxdrawing: ┤
#define BOX_ULR BOX("\x76") // Boxdrawing: ┴
#define BOX_UL BOX("\x6A") // Boxdrawing: ┘
#define BOX_DLR BOX("\x77") // Boxdrawing: ┘
#define BOX_DL BOX("\x6B") // Boxdrawing: ┘
#elif 1 // UTF-8
#define BOX_LR "─" // Boxdrawing: ─
#define BOX_UD "│" // Boxdrawing: │
#define BOX_UDR "├" // Boxdrawing: ├
#define BOX_UDLR "┼" // Boxdrawing: ┼
#define BOX_UDL "┤" // Boxdrawing: ┤
#define BOX_ULR "┴" // Boxdrawing: ┴
#define BOX_UL "┘" // Boxdrawing: ┘
#define BOX_DLR "┬" // Boxdrawing: ┘
#define BOX_DL "┐" // Boxdrawing: ┘
#define BOX_UR "└" // Boxdrawing: └
#else // ASCII
#define BOX_LR "-" // Boxdrawing: ─
#define BOX_UD "|" // Boxdrawing: │
#define BOX_UDR "+" // Boxdrawing: ├
#define BOX_UDLR "+" // Boxdrawing: ┼
#define BOX_UDL "+" // Boxdrawing: ┤
#define BOX_ULR "+" // Boxdrawing: ┴
#define BOX_UL "+" // Boxdrawing: ┘
#define BOX_DLR "+" // Boxdrawing: ┘
#define BOX_DL "+" // Boxdrawing: ┘
#endif