Rune Caster 1.0.0
Modern C++ Text Processing Framework
Loading...
Searching...
No Matches
rune_caster::spell::core::WhitespaceNormalizer Class Reference

Normalize whitespace characters using C++20 concepts. More...

#include <spell_core.hpp>

Inheritance diagram for rune_caster::spell::core::WhitespaceNormalizer:
Collaboration diagram for rune_caster::spell::core::WhitespaceNormalizer:

Public Types

using input_type = RuneSequence
using output_type = RuneSequence
Public Types inherited from rune_caster::spell_base< RuneSequence >
using input_type
using output_type

Public Member Functions

 WhitespaceNormalizer (bool collapse_multiple=true, bool trim_edges=true)
 Construct a WhitespaceNormalizer.
RuneSequence operator() (const RuneSequence &input) const override
 Apply the spell transformation.
std::string description () const override
 Get the spell's description.
std::string name () const override
 Get the spell's name.
Public Member Functions inherited from rune_caster::spell_base< RuneSequence >
virtual ~spell_base ()=default

Additional Inherited Members

Static Public Member Functions inherited from rune_caster::spell_base< RuneSequence >
static constexpr bool can_process () noexcept
 Check if this spell can be applied to the given input type (C++20 concepts)
static constexpr bool produces () noexcept
 Check if this spell produces the expected output type (C++20 concepts)
static constexpr const char * input_type_name () noexcept
 Get input type name as compile-time string (C++20)
static constexpr const char * output_type_name () noexcept
 Get output type name as compile-time string (C++20)

Detailed Description

Normalize whitespace characters using C++20 concepts.

Converts various whitespace characters to standard space (U+0020) and optionally removes extra whitespace.

Definition at line 17 of file spell_core.hpp.

Member Typedef Documentation

◆ input_type

◆ output_type

Constructor & Destructor Documentation

◆ WhitespaceNormalizer()

rune_caster::spell::core::WhitespaceNormalizer::WhitespaceNormalizer ( bool collapse_multiple = true,
bool trim_edges = true )
explicit

Construct a WhitespaceNormalizer.

Parameters
collapse_multipleIf true, collapse multiple whitespace into single space
trim_edgesIf true, remove leading and trailing whitespace

Definition at line 10 of file whitespace_normalizer.cpp.

Member Function Documentation

◆ description()

std::string rune_caster::spell::core::WhitespaceNormalizer::description ( ) const
overridevirtual

Get the spell's description.

Returns
A human-readable description of what the spell does

Implements rune_caster::spell_base< RuneSequence >.

Definition at line 75 of file whitespace_normalizer.cpp.

◆ name()

std::string rune_caster::spell::core::WhitespaceNormalizer::name ( ) const
inlineoverridevirtual

Get the spell's name.

Returns
A string identifying the spell

Implements rune_caster::spell_base< RuneSequence >.

Definition at line 35 of file spell_core.hpp.

◆ operator()()

RuneSequence rune_caster::spell::core::WhitespaceNormalizer::operator() ( const RuneSequence & input) const
overridevirtual

Apply the spell transformation.

Parameters
inputThe input data to transform
Returns
The transformed output

Implements rune_caster::spell_base< RuneSequence >.

Definition at line 14 of file whitespace_normalizer.cpp.


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