This commit is contained in:
Даниил Заикин
2026-06-17 20:44:53 +03:00
parent 9d153773c2
commit b133e7c656
1880 changed files with 244545 additions and 0 deletions
@@ -0,0 +1,22 @@
namespace QFSW.QC.Parsers
{
public class BoolParser : BasicCachedQcParser<bool>
{
public override bool Parse(string value)
{
value = value.ToLower().Trim();
switch (value)
{
case "true": return true;
case "on": return true;
case "1": return true;
case "yes": return true;
case "false": return false;
case "off": return false;
case "0": return false;
case "no": return false;
default: throw new ParserInputException($"Cannot parse '{value}' to a bool.");
}
}
}
}