Icarus
Vehicle Simulation as a Transformable Computational Graph, built on Vulcan and Janus
Loading...
Searching...
No Matches
Banner.hpp
Go to the documentation of this file.
1#pragma once
2
9
10#include <string>
11
12namespace icarus {
13
17class Banner {
18 public:
20 [[nodiscard]] static std::string GetSplashScreen(const std::string &build_type = "RELEASE",
21 const std::string &version = "0.1.0") {
22 // clang-format off
23 return R"(
24################################################################################
25# #
26# ██╗ ██████╗ █████╗ ██████╗ ██╗ ██╗███████╗ #
27# ██║██╔════╝██╔══██╗██╔══██╗██║ ██║██╔════╝ #
28# ██║██║ ███████║██████╔╝██║ ██║███████╗ #
29# ██║██║ ██╔══██║██╔══██╗██║ ██║╚════██║ #
30# ██║╚██████╗██║ ██║██║ ██║╚██████╔╝███████║ #
31# ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝ #
32# #
33# 6DOF FLIGHT DYNAMICS ENGINE | BUILD: )" + PadRight(build_type, 7) + " | VER: " + PadRight(version, 7) + R"( #
34################################################################################
35)";
36 // clang-format on
37 }
40 [[nodiscard]] static std::string GetLifecycleHeader(const std::string &lifecycle_name) {
41 std::string header = "─── [ LIFECYCLE: " + lifecycle_name + " ] ";
42 std::size_t remaining = (header.size() < 80) ? (80 - header.size()) : 0;
43 for (std::size_t i = 0; i < remaining; ++i) {
44 header += "─";
45 }
46 return header;
47 }
50 [[nodiscard]] static std::string GetDebriefHeader() {
51 return R"(
52================================================================================
53 MISSION DEBRIEF
54================================================================================)";
55 }
56
57 /// Get horizontal rule
58 [[nodiscard]] static std::string GetRule(int width = 80, char c = '=') {
59 return std::string(static_cast<std::size_t>(width), c);
60 }
61
63 [[nodiscard]] static std::string GetDoubleRule(int width = 80) {
64 std::string rule;
65 for (int i = 0; i < width; ++i) {
66 rule += "═";
67 }
68 return rule;
69 }
70
72 [[nodiscard]] static std::string GetSectionHeader(const std::string &title) {
73 std::string header = "─── [ " + title + " ] ";
74 std::size_t remaining = (header.size() < 80) ? (80 - header.size()) : 0;
75 for (std::size_t i = 0; i < remaining; ++i) {
76 header += "─";
77 }
78 return header;
79 }
80
81 private:
82 [[nodiscard]] static std::string PadRight(const std::string &s, std::size_t width) {
83 if (s.size() >= width) {
84 return s;
85 }
86 return s + std::string(width - s.size(), ' ');
87 }
88};
89
90} // namespace icarus
ASCII art banners and headers.
Definition Banner.hpp:17
static std::string GetDoubleRule(int width=80)
Get double-line rule.
Definition Banner.hpp:48
static std::string GetSectionHeader(const std::string &title)
Get section header (for data dictionary, etc.).
Definition Banner.hpp:57
static std::string GetLifecycleHeader(const std::string &lifecycle_name)
Get a section header.
Definition Banner.hpp:28
static std::string GetSplashScreen(const std::string &build_type="RELEASE", const std::string &version="0.1.0")
Get the main Icarus splash screen (ASCII art logo).
Definition Banner.hpp:20
static std::string GetDebriefHeader()
Get the mission debrief header.
Definition Banner.hpp:38
static std::string GetRule(int width=80, char c='=')
Get horizontal rule.
Definition Banner.hpp:43
Definition AggregationTypes.hpp:13