当前位置: 首页>>代码示例>>C++>>正文


C++ CXmlNode::PszuFindElementValue方法代码示例

本文整理汇总了C++中CXmlNode::PszuFindElementValue方法的典型用法代码示例。如果您正苦于以下问题:C++ CXmlNode::PszuFindElementValue方法的具体用法?C++ CXmlNode::PszuFindElementValue怎么用?C++ CXmlNode::PszuFindElementValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CXmlNode的用法示例。


在下文中一共展示了CXmlNode::PszuFindElementValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: oInternetResponse

void
WLayoutApplicationMayanX::SL_InternetRequestCompleted(QNetworkReply * poNetworkReply)
	{
	CInternetResponseWebMethodXmlSoap oInternetResponse(poNetworkReply);

	// First of all, check if there is an error from the server
	CXmlNode * pXmlNodeError = oInternetResponse.PGetXmlNodeError();
	if (pXmlNodeError != NULL)
		{
		MessageLog_AppendTextFormatSev(eSeverityErrorWarning, "SL_InternetRequestCompleted() with the following error:\n^N", pXmlNodeError);
		int nCode = pXmlNodeError->NFindElementOrAttributeValueNumeric("nCode");
		if (nCode == eCodeUserNotFound)
			{
			// The user is not found or does not exist, therefore clear the m_strxUserID so we may retry
			m_pApplication->m_strxUserID.Empty();
			}
		if (nCode == eCodeUserAlreadyExist)
			{
			// The user already exists, so fetch the xUserID from the
			m_pApplication->m_strxUserID = pXmlNodeError->PszuFindElementValue("xDescriptionParam");
			SL_ExchangeLogin();	// Attempt to login again
			}
		return;
		}

	CXmlNode * pXmlNode = oInternetResponse.PGetXmlNodeResponse("UserRegister");
	if (pXmlNode != NULL)
		{
		m_pApplication->m_strxUserID = pXmlNode->m_pszuTagValue;
		if (!m_pApplication->m_strxUserID.FIsEmptyString())
			SL_ExchangeLogin();		// Attempt to login with the new UserID.
		else
			EMessageBoxWarning("The API 'UserRegister' returned an invalid UserID of value '$S'", &m_pApplication->m_strxUserID);
		return;
		}
	pXmlNode = oInternetResponse.PGetXmlNodeResponse("UserLogin");
	if (pXmlNode != NULL)
		{
		CBin binChallenge;
		binChallenge.BinAppendBinaryDataFromBase64Szv(pXmlNode->PszuFindElementValue("bChallenge"));
		if (!binChallenge.FIsEmptyBinary())
			{
			// We received a challenge, so respond to it now
			CBin binResponseData = m_pApplication->m_pProfileParent->m_strKeyPublic;
			binResponseData.BinAppendCBin(binChallenge);
			//MessageLog_AppendTextFormatCo(d_coBlue, " bIdentity: {B/}\n bChallenge: {B/}\n bIdentity + bChallenge: {B/}\n", &m_pTreeItemParent->m_binKeyPublic, &binChallenge, &binResponseData);
			binResponseData.BinHashToMd5();

			CInternetRequestWebMethodXmlMayanX oRequest("UserLogin");
			oRequest.BinAppendXmlElementText("xUserID", m_pApplication->m_strxUserID);
			oRequest.BinAppendXmlElementBinaryBase64("bResponse", binResponseData);
			m_oInternetServer.RequestSend(&oRequest);
			return;
			}
		if (m_oInternetServer.m_strxSessionID.FIsEmptyString())
			{
			m_oInternetServer.m_strxSessionID = pXmlNode->PszuFindElementValue("xSessionID");
			//m_oInternetServer.m_strxSessionID = (PSZUC)"as8323jas932e";
			if (!m_oInternetServer.m_strxSessionID.FIsEmptyString())
				{
				MessageLog_AppendTextFormatCo(d_coBlue, "Login successful: xSessionID = $S\n", &m_oInternetServer.m_strxSessionID);
				OLayoutHorizontal * poLayoutOrder = new OLayoutHorizontal((QWidget *)NULL);
				m_poLayoutButtons->addRow(poLayoutOrder);
				m_pwEditQuantity = new WEditNumber;
				poLayoutOrder->Layout_AddLabelAndWidgetH_PA("Quantity:", m_pwEditQuantity);
				m_pwEditPrice = new WEditNumber;
				poLayoutOrder->Layout_AddLabelAndWidgetH_PA("Price:", m_pwEditPrice);
				WButtonTextWithIcon * pwButton = new WButtonTextWithIcon("Place Order", eMenuIcon_Bitcoin); // eMenuIconCoffeeBuy);
				poLayoutOrder->addWidget(pwButton);
				poLayoutOrder->addWidget(PA_CHILD new QWidget, 1);
				connect(pwButton, SIGNAL(clicked()), this, SLOT(SL_ButtonUserOrderAdd()));

				//Updating user balance
				OLayoutHorizontal * poLayoutUserBalance = new OLayoutHorizontal((QWidget *)NULL);
				m_poLayoutButtons->addRow(poLayoutUserBalance);
                m_pwEditUpdateBalanceQuantity = new WEditNumber;
                m_pwEditUpdateBalanceUserId = new WEditNumber;
                poLayoutUserBalance->Layout_AddLabelAndWidgetH_PA("User Id:", m_pwEditUpdateBalanceUserId);
                poLayoutUserBalance->Layout_AddLabelAndWidgetH_PA("Quantity:", m_pwEditUpdateBalanceQuantity);
                m_pwLabelBalance=new WLabel;
				pwButton = new WButtonTextWithIcon("Update Balance", eMenuIcon_Bitcoin); // eMenuIconCoffeeBuy);
                poLayoutUserBalance->addWidget(pwButton);
                poLayoutUserBalance->addWidget(m_pwLabelBalance);
				poLayoutUserBalance->addWidget(PA_CHILD new QWidget, 1);
                connect(pwButton, SIGNAL(clicked()), this, SLOT(SL_ButtonUserBalanceUpdate()));

                //Cancel an Order
                OLayoutHorizontal * poLayoutCancelAnOrder = new OLayoutHorizontal((QWidget *)NULL);
                m_poLayoutButtons->addRow(poLayoutCancelAnOrder);
                m_pwEditIdToCancelOrder = new WEditNumber;
                poLayoutCancelAnOrder->Layout_AddLabelAndWidgetH_PA("Id:", m_pwEditIdToCancelOrder);
				pwButton = new WButtonTextWithIcon("Cancel Order", eMenuIcon_Bitcoin); // eMenuIconCoffeeBuy);
                poLayoutCancelAnOrder->addWidget(pwButton);
                poLayoutCancelAnOrder->addWidget(PA_CHILD new QWidget, 1);
                connect(pwButton, SIGNAL(clicked()), this, SLOT(SL_ButtonUserOrderCancel()));

                //Update an Order
                OLayoutHorizontal * poLayoutUpdateAnOrder = new OLayoutHorizontal((QWidget *)NULL);
                m_poLayoutButtons->addRow(poLayoutUpdateAnOrder);
                m_pwEditIdToUpdateOrder = new WEditNumber;
//.........这里部分代码省略.........
开发者ID:plato-cambrian,项目名称:Cambrian-src,代码行数:101,代码来源:WLayoutApplicationMayanX.cpp


注:本文中的CXmlNode::PszuFindElementValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。