cimoperationresponsedecoder.cpp
来自「Pegasus is an open-source implementation」· C++ 代码 · 共 1,785 行 · 第 1/4 页
CPP
1,785 行
cimException, QueueIdStack());}CIMSetQualifierResponseMessage* CIMOperationResponseDecoder::_decodeSetQualifierResponse( XmlParser& parser, const String& messageId, Boolean isEmptyImethodresponseTag){ XmlEntry entry; CIMException cimException; if (!isEmptyImethodresponseTag) { if (XmlReader::getErrorElement(parser, cimException)) { return new CIMSetQualifierResponseMessage( messageId, cimException, QueueIdStack()); } if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE")) { if (entry.type != XmlEntry::EMPTY_TAG) { XmlReader::expectEndTag(parser, "IRETURNVALUE"); } } } return new CIMSetQualifierResponseMessage( messageId, cimException, QueueIdStack());}CIMGetQualifierResponseMessage* CIMOperationResponseDecoder::_decodeGetQualifierResponse( XmlParser& parser, const String& messageId, Boolean isEmptyImethodresponseTag){ XmlEntry entry; CIMException cimException; if (isEmptyImethodresponseTag) { MessageLoaderParms mlParms("Common.XmlReader.EXPECTED_OPEN", "Expected open of $0 element", "IMETHODRESPONSE"); throw XmlValidationError(parser.getLine(), mlParms); } else if (XmlReader::getErrorElement(parser, cimException)) { return new CIMGetQualifierResponseMessage( messageId, cimException, QueueIdStack(), CIMQualifierDecl()); } else if (XmlReader::testStartTag(parser, entry, "IRETURNVALUE")) { CIMQualifierDecl qualifierDecl; XmlReader::getQualifierDeclElement(parser, qualifierDecl); XmlReader::expectEndTag(parser, "IRETURNVALUE"); return new CIMGetQualifierResponseMessage( messageId, cimException, QueueIdStack(), qualifierDecl); } else { MessageLoaderParms mlParms( "Client.CIMOperationResponseDecoder." "EXPECTED_ERROR_OR_IRETURNVALUE_ELEMENT", "expected ERROR or IRETURNVALUE element"); throw XmlValidationError(parser.getLine(), mlParms); }}CIMEnumerateQualifiersResponseMessage* CIMOperationResponseDecoder::_decodeEnumerateQualifiersResponse( XmlParser& parser, const String& messageId, Boolean isEmptyImethodresponseTag){ XmlEntry entry; CIMException cimException; Array<CIMQualifierDecl> qualifierDecls; if (!isEmptyImethodresponseTag) { if (XmlReader::getErrorElement(parser, cimException)) { return new CIMEnumerateQualifiersResponseMessage( messageId, cimException, QueueIdStack(), Array<CIMQualifierDecl>()); } if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE")) { if (entry.type != XmlEntry::EMPTY_TAG) { CIMQualifierDecl qualifierDecl; while (XmlReader::getQualifierDeclElement( parser, qualifierDecl)) { qualifierDecls.append(qualifierDecl); } XmlReader::expectEndTag(parser, "IRETURNVALUE"); } } } return new CIMEnumerateQualifiersResponseMessage( messageId, cimException, QueueIdStack(), qualifierDecls);}CIMDeleteQualifierResponseMessage* CIMOperationResponseDecoder::_decodeDeleteQualifierResponse( XmlParser& parser, const String& messageId, Boolean isEmptyImethodresponseTag){ XmlEntry entry; CIMException cimException; if (!isEmptyImethodresponseTag) { if (XmlReader::getErrorElement(parser, cimException)) { return new CIMDeleteQualifierResponseMessage( messageId, cimException, QueueIdStack()); } if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE")) { if (entry.type != XmlEntry::EMPTY_TAG) { XmlReader::expectEndTag(parser, "IRETURNVALUE"); } } } return new CIMDeleteQualifierResponseMessage( messageId, cimException, QueueIdStack());}CIMReferenceNamesResponseMessage* CIMOperationResponseDecoder::_decodeReferenceNamesResponse( XmlParser& parser, const String& messageId, Boolean isEmptyImethodresponseTag){ XmlEntry entry; CIMException cimException; Array<CIMObjectPath> objectPaths; if (!isEmptyImethodresponseTag) { if (XmlReader::getErrorElement(parser, cimException)) { return new CIMReferenceNamesResponseMessage( messageId, cimException, QueueIdStack(), Array<CIMObjectPath>()); } if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE")) { if (entry.type != XmlEntry::EMPTY_TAG) { CIMObjectPath objectPath; while (XmlReader::getObjectPathElement(parser, objectPath)) objectPaths.append(objectPath); XmlReader::expectEndTag(parser, "IRETURNVALUE"); } } } return new CIMReferenceNamesResponseMessage( messageId, cimException, QueueIdStack(), objectPaths);}CIMReferencesResponseMessage* CIMOperationResponseDecoder::_decodeReferencesResponse( XmlParser& parser, const String& messageId, Boolean isEmptyImethodresponseTag){ XmlEntry entry; CIMException cimException; Array<CIMObject> objectWithPathArray; if (!isEmptyImethodresponseTag) { if (XmlReader::getErrorElement(parser, cimException)) { return new CIMReferencesResponseMessage( messageId, cimException, QueueIdStack(), Array<CIMObject>()); } if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE")) { if (entry.type != XmlEntry::EMPTY_TAG) { CIMObject objectWithPath; while (XmlReader::getValueObjectWithPathElement( parser, objectWithPath)) { objectWithPathArray.append(objectWithPath); } XmlReader::expectEndTag(parser, "IRETURNVALUE"); } } } return new CIMReferencesResponseMessage( messageId, cimException, QueueIdStack(), objectWithPathArray);}CIMAssociatorNamesResponseMessage* CIMOperationResponseDecoder::_decodeAssociatorNamesResponse( XmlParser& parser, const String& messageId, Boolean isEmptyImethodresponseTag){ XmlEntry entry; CIMException cimException; Array<CIMObjectPath> objectPaths; if (!isEmptyImethodresponseTag) { if (XmlReader::getErrorElement(parser, cimException)) { return new CIMAssociatorNamesResponseMessage( messageId, cimException, QueueIdStack(), Array<CIMObjectPath>()); } if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE")) { if (entry.type != XmlEntry::EMPTY_TAG) { CIMObjectPath objectPath; while (XmlReader::getObjectPathElement(parser, objectPath)) objectPaths.append(objectPath); XmlReader::expectEndTag(parser, "IRETURNVALUE"); } } } return new CIMAssociatorNamesResponseMessage( messageId, cimException, QueueIdStack(), objectPaths);}CIMAssociatorsResponseMessage* CIMOperationResponseDecoder::_decodeAssociatorsResponse( XmlParser& parser, const String& messageId, Boolean isEmptyImethodresponseTag){ XmlEntry entry; CIMException cimException; Array<CIMObject> objectWithPathArray; if (!isEmptyImethodresponseTag) { if (XmlReader::getErrorElement(parser, cimException)) { return new CIMAssociatorsResponseMessage( messageId, cimException, QueueIdStack(), Array<CIMObject>()); } if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE")) { if (entry.type != XmlEntry::EMPTY_TAG) { CIMObject objectWithPath; while (XmlReader::getValueObjectWithPathElement( parser, objectWithPath)) { objectWithPathArray.append(objectWithPath); } XmlReader::expectEndTag(parser, "IRETURNVALUE"); } } } return new CIMAssociatorsResponseMessage( messageId, cimException, QueueIdStack(), objectWithPathArray);}CIMExecQueryResponseMessage* CIMOperationResponseDecoder::_decodeExecQueryResponse( XmlParser& parser, const String& messageId, Boolean isEmptyImethodresponseTag){ XmlEntry entry; CIMException cimException; Array<CIMObject> objectWithPathArray; if (!isEmptyImethodresponseTag) { if (XmlReader::getErrorElement(parser, cimException)) { return new CIMExecQueryResponseMessage( messageId, cimException, QueueIdStack(), Array<CIMObject>()); } if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE")) { if (entry.type != XmlEntry::EMPTY_TAG) { XmlReader::getObjectArray(parser, objectWithPathArray); XmlReader::expectEndTag(parser, "IRETURNVALUE"); } } } return new CIMExecQueryResponseMessage( messageId, cimException, QueueIdStack(), objectWithPathArray);}CIMInvokeMethodResponseMessage* CIMOperationResponseDecoder::_decodeInvokeMethodResponse( XmlParser& parser, const String& messageId, const String& methodName, Boolean isEmptyMethodresponseTag){ CIMException cimException; CIMParamValue paramValue; Array<CIMParamValue> outParameters; CIMValue returnValue; if (!isEmptyMethodresponseTag) { if (XmlReader::getErrorElement(parser, cimException)) { return new CIMInvokeMethodResponseMessage( messageId, cimException, QueueIdStack(), returnValue, outParameters, methodName); } Boolean isReturnValue = false; Boolean isParamValue = false; Boolean gotReturnValue = false; while ((isReturnValue = XmlReader::getReturnValueElement(parser, returnValue)) || (isParamValue = XmlReader::getParamValueElement(parser, paramValue))) { if (isReturnValue) { if (gotReturnValue) { MessageLoaderParms mlParms( "Client.CIMOperationResponseDecoder." "EXPECTED_RETURNVALUE_ELEMENT", "unexpected RETURNVALUE element"); throw XmlValidationError(parser.getLine(), mlParms); } gotReturnValue = true; } else // isParamValue == true { outParameters.append(paramValue); } isReturnValue = false; isParamValue = false; } } return new CIMInvokeMethodResponseMessage( messageId, cimException, QueueIdStack(), returnValue, outParameters, methodName);}PEGASUS_NAMESPACE_END
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?