refactor: refactor and simplify symbol rule defines.
parent
b7cbd9d325
commit
dca7c5831f
File diff suppressed because it is too large
Load Diff
|
@ -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)
|
public static int? ParseNullableInt(string str)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(str))
|
if (string.IsNullOrEmpty(str))
|
||||||
|
|
Loading…
Reference in New Issue