misc: chore: Move all GeneratedRegex methods into one static class with static instance accessors.

This commit is contained in:
Evan Husted 2025-02-01 14:07:32 -06:00
parent 9f94aa1c79
commit 38ef65aae0
9 changed files with 139 additions and 76 deletions

View file

@ -5,6 +5,7 @@ using LibHac.FsSystem;
using LibHac.Ncm;
using LibHac.Tools.FsSystem;
using LibHac.Tools.FsSystem.NcaUtils;
using Ryujinx.Common.Helper;
using Ryujinx.Common.Logging;
using Ryujinx.HLE.HOS.Services.Am.AppletAE;
using Ryujinx.HLE.HOS.SystemState;
@ -30,9 +31,6 @@ namespace Ryujinx.HLE.HOS.Applets.Error
public event EventHandler AppletStateChanged;
[GeneratedRegex(@"[^\u0000\u0009\u000A\u000D\u0020-\uFFFF]..")]
private static partial Regex CleanTextRegex();
public ErrorApplet(Horizon horizon)
{
_horizon = horizon;
@ -107,7 +105,7 @@ namespace Ryujinx.HLE.HOS.Applets.Error
private static string CleanText(string value)
{
return CleanTextRegex().Replace(value, string.Empty).Replace("\0", string.Empty);
return Patterns.CleanText.Replace(value, string.Empty).Replace("\0", string.Empty);
}
private string GetMessageText(uint module, uint description, string key)