Porytiles
Loading...
Searching...
No Matches
components.cpp
Go to the documentation of this file.
2
3#include "fruit/fruit.h"
4
7
8namespace porytiles2::di {
9
10fruit::Component<TextFormatter> get_formatter_component(bool no_color)
11{
12 if (no_color) {
13 return fruit::createComponent()
15 .registerConstructor<PlainTextFormatter()>();
16 }
17 return fruit::createComponent()
19 .registerConstructor<AnsiStyledTextFormatter()>();
20}
21
22} // namespace porytiles2::di
TextFormatter implementation that applies ANSI escape codes for terminal styling.
TextFormatter implementation that strips all styling from text.
Abstract base class for applying text styling with context-aware formatting.
fruit::Component< TextFormatter > get_formatter_component(bool no_color)
Component that provides TextFormatter based on runtime configuration.