Consolix
Loading...
Searching...
No Matches
consolix::LogoComponent Class Reference

Component responsible for displaying a customizable ASCII logo. More...

#include <LogoComponent.hpp>

Inheritance diagram for consolix::LogoComponent:
consolix::IAppComponent

Public Member Functions

 LogoComponent (TextColor color=TextColor::DarkYellow)
 Constructs a LogoComponent with a default logo and color.
 
 LogoComponent (const std::string &logo, TextColor color=TextColor::DarkYellow)
 Constructs a LogoComponent with a custom logo and color.
 
virtual ~LogoComponent ()=default
 Virtual destructor.
 
void set_logo (const std::string &logo, TextColor color)
 Sets a custom logo and color.
 
bool initialize () override
 Initializes the component and displays the logo.
 
bool is_initialized () const override
 Checks if the component has been initialized.
 
void process () override
 Executes the component (no operation for LogoComponent).
 
- Public Member Functions inherited from consolix::IAppComponent
virtual ~IAppComponent ()=default
 Virtual destructor for polymorphic usage.
 

Private Member Functions

void set_console_color ()
 Sets the console color before displaying the logo.
 
void reset_console_color ()
 Resets the console color to the default.
 

Private Attributes

std::string m_logo
 The ASCII logo text to display.
 
TextColor m_color
 The color of the logo.
 
std::atomic< bool > m_is_init {false}
 Indicates whether the component is initialized.
 

Detailed Description

Component responsible for displaying a customizable ASCII logo.

This component allows for displaying an ASCII logo with optional color customization. It supports direct console output or integration with LogIt for styled logging.

Definition at line 24 of file LogoComponent.hpp.

Constructor & Destructor Documentation

◆ LogoComponent() [1/2]

consolix::LogoComponent::LogoComponent ( TextColor color = TextColor::DarkYellow)
inline

Constructs a LogoComponent with a default logo and color.

Parameters
colorThe color to use for the logo (default: DarkYellow).

Definition at line 28 of file LogoComponent.hpp.

◆ LogoComponent() [2/2]

consolix::LogoComponent::LogoComponent ( const std::string & logo,
TextColor color = TextColor::DarkYellow )
inline

Constructs a LogoComponent with a custom logo and color.

Parameters
logoThe ASCII logo to display.
colorThe color to use for the logo (default: DarkYellow).

Definition at line 90 of file LogoComponent.hpp.

◆ ~LogoComponent()

virtual consolix::LogoComponent::~LogoComponent ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ initialize()

bool consolix::LogoComponent::initialize ( )
inlineoverridevirtual

Initializes the component and displays the logo.

Returns
true if initialization succeeds, false otherwise.

Implements consolix::IAppComponent.

Definition at line 109 of file LogoComponent.hpp.

◆ is_initialized()

bool consolix::LogoComponent::is_initialized ( ) const
inlineoverridevirtual

Checks if the component has been initialized.

Returns
true if the component is initialized, false otherwise.

Implements consolix::IAppComponent.

Definition at line 129 of file LogoComponent.hpp.

◆ process()

void consolix::LogoComponent::process ( )
inlineoverridevirtual

Executes the component (no operation for LogoComponent).

Implements consolix::IAppComponent.

Definition at line 134 of file LogoComponent.hpp.

◆ reset_console_color()

void consolix::LogoComponent::reset_console_color ( )
inlineprivate

Resets the console color to the default.

Definition at line 154 of file LogoComponent.hpp.

◆ set_console_color()

void consolix::LogoComponent::set_console_color ( )
inlineprivate

Sets the console color before displaying the logo.

Definition at line 142 of file LogoComponent.hpp.

◆ set_logo()

void consolix::LogoComponent::set_logo ( const std::string & logo,
TextColor color )
inline

Sets a custom logo and color.

Parameters
logoThe custom ASCII logo as a string.
colorThe color to display the logo in.

Definition at line 102 of file LogoComponent.hpp.

Member Data Documentation

◆ m_color

TextColor consolix::LogoComponent::m_color
private

The color of the logo.

Definition at line 138 of file LogoComponent.hpp.

◆ m_is_init

std::atomic<bool> consolix::LogoComponent::m_is_init {false}
private

Indicates whether the component is initialized.

Definition at line 139 of file LogoComponent.hpp.

◆ m_logo

std::string consolix::LogoComponent::m_logo
private

The ASCII logo text to display.

Definition at line 137 of file LogoComponent.hpp.


The documentation for this class was generated from the following file: