* @brief As "GetArgValue" but parsed as a boolean. *************************************************************/
| 149 | * @brief As "GetArgValue" but parsed as a boolean. |
| 150 | *************************************************************/ |
| 151 | bool AnalyzeXML::GetArgBool(char const* pArgName, int argPos, bool defaultValue) const |
| 152 | { |
| 153 | char const* pValue = m_ArgMap.GetArgValue(pArgName, argPos) ; |
| 154 | |
| 155 | if (!pValue) |
| 156 | { |
| 157 | return defaultValue ; |
| 158 | } |
| 159 | |
| 160 | // If the default is true, we only need to test for false explicitly. |
| 161 | // Anything else is true and vice versa if the default is false. |
| 162 | // (This just saves an unnecessary string comparison). |
| 163 | if (defaultValue) |
| 164 | { |
| 165 | return (!IsStringEqualIgnoreCase(pValue, sml_Names::kFalse)) ; |
| 166 | } |
| 167 | else |
| 168 | { |
| 169 | return (IsStringEqualIgnoreCase(pValue, sml_Names::kTrue)) ; |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | /************************************************************* |
| 174 | * @brief As "GetArgValue" but parsed as an int. |
no test coverage detected