Rune Caster 1.0.0
Modern C++ Text Processing Framework
Loading...
Searching...
No Matches
rune_caster::spell::composition Namespace Reference

Classes

class  SpellComposition
 Composition of two spells into a single spell pipeline. More...

Functions

template<typename FirstSpell, typename SecondSpell>
auto compose (FirstSpell &&first, SecondSpell &&second)
 Compose two spells into a single spell pipeline.
template<typename Spell>
RuneSequence cast_spell (const RuneSequence &input, const Spell &spell)
 Helper function for casting spells on RuneSequence.
template<typename Spell>
std::string cast_spell (std::string_view utf8_input, const Spell &spell)
 Helper function for casting spells on UTF-8 strings.

Function Documentation

◆ cast_spell() [1/2]

template<typename Spell>
RuneSequence rune_caster::spell::composition::cast_spell ( const RuneSequence & input,
const Spell & spell )

Helper function for casting spells on RuneSequence.

This is a convenience function that applies a spell to a RuneSequence and returns the transformed result.

Template Parameters
SpellThe type of spell to apply
Parameters
inputThe input sequence to transform
spellThe spell to apply
Returns
The transformed sequence

Definition at line 117 of file spell_composition.hpp.

◆ cast_spell() [2/2]

template<typename Spell>
std::string rune_caster::spell::composition::cast_spell ( std::string_view utf8_input,
const Spell & spell )

Helper function for casting spells on UTF-8 strings.

This is a convenience function that converts a UTF-8 string to RuneSequence, applies the spell, and converts back to UTF-8 string.

Template Parameters
SpellThe type of spell to apply
Parameters
utf8_inputThe UTF-8 input string
spellThe spell to apply
Returns
The transformed string as UTF-8

Definition at line 134 of file spell_composition.hpp.

◆ compose()

template<typename FirstSpell, typename SecondSpell>
auto rune_caster::spell::composition::compose ( FirstSpell && first,
SecondSpell && second )

Compose two spells into a single spell pipeline.

This function creates a SpellComposition that applies the first spell, then applies the second spell to the result. Uses C++20 concepts for compile-time validation.

Template Parameters
FirstSpellThe type of the first spell
SecondSpellThe type of the second spell
Parameters
firstThe first spell to apply
secondThe second spell to apply
Returns
A composed spell that applies both spells in sequence

Definition at line 94 of file spell_composition.hpp.