Gems/EMotionFX/Code/MCore/Source/CommandLine.cpp
bool CommandLine::GetValueAsBool(const char* paramName, bool defaultValue) const
    {
        // try to find the parameter index
        const size_t paramIndex = FindParameterIndex(paramName);
        if (paramIndex == InvalidIndex)
        {
            return defaultValue;
        }

        // return the default value if the parameter value is empty
        if (m_parameters[paramIndex].m_value.empty())
        {
            return true;
        }

        // return the parameter value
        return AzFramework::StringFunc::ToBool(m_parameters[paramIndex].m_value.c_str());
    }
// get the value as a boolean
get the value as a boolean
get the value as a boolean
bool CommandLine::GetValueAsBool(const char* paramName, bool defaultValue) const
    {
        const size_t paramIndex = FindParameterIndex(paramName);
        if (paramIndex == InvalidIndex)
        {
            return defaultValue;
        }
        if (m_parameters[paramIndex].m_value.empty())
        {
            return true;
        }
        return AzFramework::StringFunc::ToBool(m_parameters[paramIndex].m_value.c_str());
    }
bool CommandLine :: GetValueAsBool ( const char * paramName , bool defaultValue ) const { const size_t paramIndex = FindParameterIndex ( paramName ) ; if ( paramIndex == InvalidIndex ) { return defaultValue ; } if ( m_parameters [ paramIndex ] . m_value . empty ( ) ) { return true ; } return AzFramework :: StringFunc :: ToBool ( m_parameters [ paramIndex ] . m_value . c_str ( ) ) ; }
get the value as a boolean
get the value as a boolean
// try to find the parameter index // return the default value if the parameter value is empty // return the parameter value