Adding GetBool method to CmdLineArg

Signed-off-by: Gene Walters <genewalt@amazon.com>
This commit is contained in:
Gene Walters
2021-11-30 11:10:00 -08:00
parent 9c9d2c70f5
commit d600b1c9fd
3 changed files with 26 additions and 0 deletions
+17
View File
@@ -42,5 +42,22 @@ const int CCmdLineArg::GetIValue() const
{
return atoi(m_value.c_str());
}
const bool CCmdLineArg::GetBoolValue(bool& cmdLineValue) const
{
AZStd::string lowercaseValue(m_value);
AZStd::to_lower(lowercaseValue.begin(), lowercaseValue.end());
if (lowercaseValue == "true")
{
cmdLineValue = true;
return true;
}
if (lowercaseValue == "false")
{
cmdLineValue = false;
return true;
}
return false;
}