HF Interface Wrapper 0.1.0-dev
Embedded C++ hardware abstraction layer
Loading...
Searching...
No Matches
AsciiArtGenerator Class Reference

Simple ASCII art generator. More...

#include <AsciiArtGenerator.h>

Public Member Functions

 AsciiArtGenerator () noexcept
 Default constructor.
 
 ~AsciiArtGenerator () noexcept=default
 Destructor.
 
std::string Generate (const std::string &input) const noexcept
 Generate ASCII art from string.
 
void AddCustomCharacter (char character, const std::vector< std::string > &art_lines) noexcept
 Add custom character mapping.
 
void RemoveCustomCharacter (char character) noexcept
 Remove custom character mapping.
 
void ClearCustomCharacters () noexcept
 Clear all custom character mappings.
 
bool IsCharacterSupported (char character) const noexcept
 Check if character is supported.
 
std::string GetSupportedCharacters () const noexcept
 Get supported characters.
 

Private Member Functions

std::vector< std::string > GetCharacterArt (char character) const noexcept
 Get art lines for a character.
 

Private Attributes

std::map< char, std::vector< std::string > > custom_characters_
 Custom character mappings.
 

Detailed Description

Simple ASCII art generator.

This class provides a simple ASCII art generator that creates large, stylized text from input strings. It focuses only on generating plain ASCII art without formatting - formatting is handled by the Logger system.

Key Features:

  • Simple Interface: Just generate ASCII art
  • Performance Optimized: Efficient string handling
  • Extensible: Easy to add new fonts and characters
  • No Formatting: Pure ASCII art generation

Usage Example:

// Basic usage
std::string art = generator.Generate("Hello World");
// Use with Logger for formatting
Logger& logger = Logger::GetInstance();
logger.LogAsciiArt("BANNER", art, AsciiArtFormat{});
Simple ASCII art generator.
Definition AsciiArtGenerator.h:61
std::string Generate(const std::string &input) const noexcept
Generate ASCII art from string.
Definition AsciiArtGenerator.cpp:119

Constructor & Destructor Documentation

◆ AsciiArtGenerator()

AsciiArtGenerator::AsciiArtGenerator ( )
noexcept

Default constructor.

◆ ~AsciiArtGenerator()

AsciiArtGenerator::~AsciiArtGenerator ( )
defaultnoexcept

Destructor.

Member Function Documentation

◆ AddCustomCharacter()

void AsciiArtGenerator::AddCustomCharacter ( char character,
const std::vector< std::string > & art_lines )
noexcept

Add custom character mapping.

Parameters
characterCharacter to map
art_linesVector of art lines for the character

◆ ClearCustomCharacters()

void AsciiArtGenerator::ClearCustomCharacters ( )
noexcept

Clear all custom character mappings.

◆ Generate()

std::string AsciiArtGenerator::Generate ( const std::string & input) const
noexcept

Generate ASCII art from string.

Parameters
inputInput string to convert
Returns
Generated ASCII art

◆ GetCharacterArt()

std::vector< std::string > AsciiArtGenerator::GetCharacterArt ( char character) const
privatenoexcept

Get art lines for a character.

Parameters
characterCharacter to get art for
Returns
Vector of art lines

◆ GetSupportedCharacters()

std::string AsciiArtGenerator::GetSupportedCharacters ( ) const
noexcept

Get supported characters.

Returns
String of supported characters

◆ IsCharacterSupported()

bool AsciiArtGenerator::IsCharacterSupported ( char character) const
noexcept

Check if character is supported.

Parameters
characterCharacter to check
Returns
true if supported, false otherwise

◆ RemoveCustomCharacter()

void AsciiArtGenerator::RemoveCustomCharacter ( char character)
noexcept

Remove custom character mapping.

Parameters
characterCharacter to remove

Member Data Documentation

◆ custom_characters_

std::map<char, std::vector<std::string> > AsciiArtGenerator::custom_characters_
private

Custom character mappings.


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