MUSX Document Model
Loading...
Searching...
No Matches
musx::dom::LyricsSyllableInfo::ElisionRun Class Reference

One text run produced by splitting a syllable's text at an embedded Finale elision marker. See LyricsSyllableInfo::calcElisionRuns. More...

#include <CommonClasses.h>

Public Member Functions

std::string text () const
 This run's text (all style chunks concatenated).
 
bool iterateStyles (util::EnigmaString::TextChunkCallback callback) const
 Iterates this run's already-resolved style chunks. In the common case (one style throughout the run) the callback is called exactly once.
 

Public Attributes

std::optional< char32_t > joinMarker
 The codepoint joining this run to the previous one; absent for the first run.
 
bool hasHyphenBefore {}
 See LyricsSyllableInfo::hasHyphenBefore.
 
bool hasHyphenAfter {}
 See LyricsSyllableInfo::hasHyphenAfter.
 

Friends

class LyricsSyllableInfo
 

Detailed Description

One text run produced by splitting a syllable's text at an embedded Finale elision marker. See LyricsSyllableInfo::calcElisionRuns.

hasHyphenBefore and hasHyphenAfter are redistributed from the whole syllable: only the first run can carry hasHyphenBefore, and only the last can carry hasHyphenAfter. A syllable preceded and followed by a hyphen therefore splits into an hasHyphenAfter-only run followed by an hasHyphenBefore-only run; hasHyphenBefore and hasHyphenAfter are never both true on the same run of a split.

A run's style chunks are resolved when the run is created, so it holds no reference back to its syllable and is safe to copy or store independently of it.

Member Function Documentation

◆ iterateStyles()

bool musx::dom::LyricsSyllableInfo::ElisionRun::iterateStyles ( util::EnigmaString::TextChunkCallback  callback) const

Iterates this run's already-resolved style chunks. In the common case (one style throughout the run) the callback is called exactly once.

Parameters
callbackThe callback for each chunk of this run with a different style.
Returns
True if the run was fully parsed. False if parsing was aborted by the callback function.