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

Method AddSimpleResultToSMLResponse

Core/ConnectionSML/src/sml_Connection.cpp:1061–1085  ·  view source on GitHub ↗

* @brief Adds a tag and fills in character data for that result. * * @param pResponse The response message we are adding an error to. * @param pResult The result (as a text string) *************************************************************/

Source from the content-addressed store, hash-verified

1059* @param pResult The result (as a text string)
1060*************************************************************/
1061void Connection::AddSimpleResultToSMLResponse(ElementXML* pResponse, char const* pResult)
1062{
1063 ClearError() ;
1064
1065#ifdef DEBUG
1066 if (!pResponse || !pResult)
1067 {
1068 SetError(Error::kNullArgument) ;
1069 return ;
1070 }
1071
1072 if (!pResponse->IsTag(sml_Names::kTagSML))
1073 {
1074 SetError(Error::kArgumentIsNotSML) ;
1075 return ;
1076 }
1077#endif
1078 // Create the result tag
1079 TagResult* pTag = new TagResult() ;
1080
1081 pTag->SetCharacterData(pResult) ;
1082 pTag->AddAttributeFastFast(sml_Names::kCommandOutput, sml_Names::kRawOutput) ;
1083
1084 pResponse->AddChild(pTag) ;
1085}
1086
1087/*************************************************************
1088* @brief Removes the top message from the incoming message queue

Callers 6

GetLastResultSMLMethod · 0.80
ReturnResultMethod · 0.80
ReturnIntResultMethod · 0.80
ReturnBoolResultMethod · 0.80
ReceivedStringEventMethod · 0.80
ReceivedRhsEventMethod · 0.80

Calls 5

SetErrorFunction · 0.85
IsTagMethod · 0.80
SetCharacterDataMethod · 0.80
AddAttributeFastFastMethod · 0.80
AddChildMethod · 0.45

Tested by

no test coverage detected