MCPcopy Create free account
hub / github.com/SoarGroup/Soar / GetArgBool

Method GetArgBool

Core/ConnectionSML/src/sml_AnalyzeXML.cpp:151–171  ·  view source on GitHub ↗

* @brief As "GetArgValue" but parsed as a boolean. *************************************************************/

Source from the content-addressed store, hash-verified

149* @brief As "GetArgValue" but parsed as a boolean.
150*************************************************************/
151bool 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.

Callers 2

HandleSuppressEventMethod · 0.45
HandleCommandLineMethod · 0.45

Calls 2

GetArgValueMethod · 0.80
IsStringEqualIgnoreCaseFunction · 0.70

Tested by

no test coverage detected