2#ifndef _CONSOLIX_TITLE_COMPONENT_HPP_INCLUDED
3#define _CONSOLIX_TITLE_COMPONENT_HPP_INCLUDED
37# if defined(_WIN32) || defined(_WIN64)
38 std::wstring wtitle = utf8_to_utf16(title);
39 SetConsoleTitleW(wtitle.c_str());
41 std::cout <<
"\033]0;" << title <<
"\007";
Interface for defining application components.
void process() override
Executes the component (no-op).
bool is_initialized() const override
Checks if the component is initialized.
std::string get_title() const
Gets the last set console title.
std::string m_title
Stores the last set title.
void set_title(const std::string &title)
Sets the console window title.
virtual ~TitleComponent() override=default
Virtual destructor.
TitleComponent(const std::string &title=std::string())
Constructs the component and optionally sets the console title.
static std::string get_executable_name()
Retrieves the executable name.
bool initialize() override
Initializes the component (no-op).
< Utility modules and helpers.
std::string get_exec_path()
Retrieves the full path of the executable.
std::string get_file_name(const std::string &file_path)
Extracts the file name from a full file path.