NoTeX 1.0.0
A modern noteworthy LaTeX template
Loading...
Searching...
No Matches
output.hpp File Reference

Styled terminal output and interactive confirmation prompts. More...

#include <optional>
#include <string_view>

Go to the source code of this file.

Namespaces

namespace  notex
namespace  notex::ui

Functions

void notex::ui::set_assume_yes (bool assume_yes)
 Sets whether confirm() should answer "yes" without prompting.
bool notex::ui::assume_yes ()
void notex::ui::success (std::string_view message)
 Prints a success message, prefixed with a green checkmark, to stdout.
void notex::ui::warning (std::string_view message)
void notex::ui::error (std::string_view message)
 Prints an error message, prefixed with a red cross, to stderr.
void notex::ui::step (std::string_view message)
 Prints a step or progress message, prefixed with an arrow, to stdout.
void notex::ui::info (std::string_view message)
 Prints a plain informational message to stdout.
bool notex::ui::confirm (std::string_view prompt, bool default_answer=false)
 Asks the user to confirm an action.
void notex::ui::set_stdin_interactive_override_for_testing (std::optional< bool > is_interactive)
 Testing seam: overrides whether confirm() treats standard input as an interactive terminal.

Detailed Description

Styled terminal output and interactive confirmation prompts.

The ui namespace is the only part of the codebase, besides constants.hpp itself, that touches the ANSI escape sequences in constants.hpp: every other component reports outcomes through these helpers instead of writing to std::cout or std::cerr directly, so that the styling stays consistent everywhere.

Definition in file output.hpp.