refactor: refactor and simplify symbol rule defines.

before-split
walon 2025-05-19 19:35:15 +08:00
parent b7cbd9d325
commit dca7c5831f
2 changed files with 336 additions and 577 deletions

View File

@ -21,6 +21,22 @@ namespace Obfuz.Utils
}
}
public static bool? ParseNullableBool(string str)
{
if (string.IsNullOrEmpty(str))
{
return null;
}
switch (str.ToLowerInvariant())
{
case "1":
case "true": return true;
case "0":
case "false": return false;
default: throw new Exception($"Invalid bool value {str}");
}
}
public static int? ParseNullableInt(string str)
{
if (string.IsNullOrEmpty(str))