mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
ISeStringEvaluator: Add ReadOnlySpan<byte> support (#2370)
* Add EvaluateMacroString ROS<byte> overload * Add implicit ROS<byte> to SeStringParameter cast
This commit is contained in:
parent
ef688c09e2
commit
e2f3fdd0ff
3 changed files with 20 additions and 0 deletions
|
|
@ -121,6 +121,15 @@ internal class SeStringEvaluator : IServiceType, ISeStringEvaluator
|
|||
return this.Evaluate(ReadOnlySeString.FromMacroString(macroString).AsSpan(), localParameters, language);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ReadOnlySeString EvaluateMacroString(
|
||||
ReadOnlySpan<byte> macroString,
|
||||
Span<SeStringParameter> localParameters = default,
|
||||
ClientLanguage? language = null)
|
||||
{
|
||||
return this.Evaluate(ReadOnlySeString.FromMacroString(macroString).AsSpan(), localParameters, language);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ReadOnlySeString EvaluateFromAddon(
|
||||
uint addonId,
|
||||
|
|
|
|||
|
|
@ -77,4 +77,6 @@ public readonly struct SeStringParameter
|
|||
public static implicit operator SeStringParameter(DSeString value) => new(new ReadOnlySeString(value.Encode()));
|
||||
|
||||
public static implicit operator SeStringParameter(string value) => new(value);
|
||||
|
||||
public static implicit operator SeStringParameter(ReadOnlySpan<byte> value) => new(value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,15 @@ public interface ISeStringEvaluator
|
|||
/// <returns>An evaluated <see cref="ReadOnlySeString"/>.</returns>
|
||||
ReadOnlySeString EvaluateMacroString(string macroString, Span<SeStringParameter> localParameters = default, ClientLanguage? language = null);
|
||||
|
||||
/// <summary>
|
||||
/// Evaluates macros in a macro string.
|
||||
/// </summary>
|
||||
/// <param name="macroString">The macro string.</param>
|
||||
/// <param name="localParameters">An optional list of local parameters.</param>
|
||||
/// <param name="language">An optional language override.</param>
|
||||
/// <returns>An evaluated <see cref="ReadOnlySeString"/>.</returns>
|
||||
ReadOnlySeString EvaluateMacroString(ReadOnlySpan<byte> macroString, Span<SeStringParameter> localParameters = default, ClientLanguage? language = null);
|
||||
|
||||
/// <summary>
|
||||
/// Evaluates macros in text from the Addon sheet.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue