Esempio n. 1
0
BOOL WizXmlRpcParamsToXml(CWizXMLDocument& doc, const CString& strMethodName, CWizXmlRpcValue* pParam1, CWizXmlRpcValue* pParam2, CWizXmlRpcValue* pParam3, CWizXmlRpcValue* pParam4,
						  CWizXmlRpcValue* pParam5, CWizXmlRpcValue* pParam6, CWizXmlRpcValue* pParam7, CWizXmlRpcValue* pParam8)
{
	CWizXMLNode nodeMethodCall;
	doc.AppendChild(_T("methodCall"), nodeMethodCall);
	//
    nodeMethodCall.SetChildNodeText(_T("methodName"), strMethodName);
	//

	CWizXMLNode nodeParams;
	nodeMethodCall.AppendChild(_T("params"), nodeParams);
	//
	CWizXmlRpcValue* arrayParams[] = {pParam1, pParam2, pParam3, pParam4, pParam5, pParam6, pParam7, pParam8, NULL};
	//
	CWizXmlRpcValue** ppParam = arrayParams;

	while (*ppParam)
	{
		CWizXMLNode nodeParamValue;
		nodeParams.AppendNodeByPath(_T("param/value"), nodeParamValue);
		//
		CWizXmlRpcValue* pParam = *ppParam;
		//
		pParam->Write(nodeParamValue);
		//
		ppParam++;
	}
	//
	return TRUE;
}
Esempio n. 2
0
void CWizXmlRpcRequest::addParam(CWizXmlRpcValue* pParam)
{
    Q_ASSERT(pParam);

    CWizXMLNode nodeParams;
    m_doc.FindNodeByPath("methodCall/params", nodeParams);

    CWizXMLNode nodeParamValue;
    nodeParams.AppendNodeByPath("param/value", nodeParamValue);

    pParam->Write(nodeParamValue);
}
Esempio n. 3
0
bool CWizXmlRpcArrayValue::Write(CWizXMLNode& nodeValue)
{
	CWizXMLNode nodeData;
    nodeValue.AppendNodeByPath("array/data", nodeData);

    std::deque<CWizXmlRpcValue*>::const_iterator it;
    for (it = m_array.begin(); it != m_array.end(); it++)
	{
		CWizXmlRpcValue* pValue = *it;

		CWizXMLNode nodeElementValue;
        nodeData.AppendChild("value", nodeElementValue);
		pValue->Write(nodeElementValue);
	}

    return true;
}
Esempio n. 4
0
BOOL CWizXmlRpcArrayValue::Write(CWizXMLNode& nodeValue)
{
	CWizXMLNode nodeData;
	nodeValue.AppendNodeByPath(_T("array/data"), nodeData);
	//
    for (std::deque<CWizXmlRpcValue*>::const_iterator it = m_array.begin();
		it != m_array.end();
		it++)
	{
		CWizXmlRpcValue* pValue = *it;
		//
		CWizXMLNode nodeElementValue;
		nodeData.AppendChild(_T("value"), nodeElementValue);
		//
		pValue->Write(nodeElementValue);
	}
	//
	return TRUE;
}