using Avalonia.Utility; namespace Avalonia.Media.TextFormatting.Unicode { public ref struct CodepointEnumerator { private ReadOnlySlice _text; public CodepointEnumerator(ReadOnlySlice text) { _text = text; Current = Codepoint.ReplacementCodepoint; } /// /// Gets the current . /// public Codepoint Current { get; private set; } /// /// Moves to the next . /// /// public bool MoveNext() { if (_text.IsEmpty) { Current = Codepoint.ReplacementCodepoint; return false; } Current = Codepoint.ReadAt(_text, 0, out var count); _text = _text.Skip(count); return true; } } }