예제 #1
0
BOOL CWizXmlRpcArrayValue::Read(CWizXMLNode& nodeValue)
{
	CWizXMLNode nodeData;
	if (!nodeValue.FindNodeByPath(_T("array/data"), nodeData))
	{
		TOLOG(_T("Failed to get array data node!"));
		return FALSE;
	}
	//
    std::deque<CWizXMLNode> arrayValue;
	nodeData.GetAllChildNodes(arrayValue);
	//
    for (std::deque<CWizXMLNode>::iterator it = arrayValue.begin();
		it != arrayValue.end();
		it++)
	{
		CWizXMLNode& nodeElementValue = *it;
		//
		CWizXmlRpcValue* pElementValue = NULL;
		if (!WizXmlRpcValueFromXml(nodeElementValue, &pElementValue ))
		{
			TOLOG(_T("Failed to load array element value from node!"));
			return FALSE;
		}
		//
		ATLASSERT(pElementValue);
		//
		Add(pElementValue);
	}
	//
	return TRUE;
}
예제 #2
0
bool CWizXmlRpcArrayValue::Read(CWizXMLNode& nodeValue)
{
	CWizXMLNode nodeData;
    if (!nodeValue.FindNodeByPath("array/data", nodeData))
	{
        TOLOG("Failed to get array data node!");
        return false;
	}

    std::deque<CWizXMLNode> arrayValue;
	nodeData.GetAllChildNodes(arrayValue);

    std::deque<CWizXMLNode>::iterator it;
    for (it = arrayValue.begin(); it != arrayValue.end(); it++)
	{
		CWizXMLNode& nodeElementValue = *it;

		CWizXmlRpcValue* pElementValue = NULL;
        if (!WizXmlRpcValueFromXml(nodeElementValue, &pElementValue))
		{
            TOLOG("Failed to load array element value from node!");
            return false;
		}

        Q_ASSERT(pElementValue);
		Add(pElementValue);
	}

    return true;
}
예제 #3
0
bool CWizXmlRpcStructValue::Read(CWizXMLNode& nodeValue)
{
	CWizXMLNode nodeStruct;
	if (!nodeValue.FindChildNode(_T("struct"), nodeStruct))
	{
		TOLOG(_T("Failed to get struct node!"));
		return FALSE;
	}
	//
    std::deque<CWizXMLNode> arrayMember;
	nodeStruct.GetAllChildNodes(arrayMember);
	//
    for (std::deque<CWizXMLNode>::iterator it = arrayMember.begin();
		it != arrayMember.end();
		it++)
	{
		CWizXMLNode& nodeMember = *it;
		//
		CString strName;
		if (!nodeMember.GetChildNodeText(_T("name"), strName))
		{
			TOLOG(_T("Failed to get struct member name!"));
			return FALSE;
		}
		//
		CWizXMLNode nodeMemberValue;
		if (!nodeMember.FindChildNode(_T("value"), nodeMemberValue))
		{
			TOLOG(_T("Failed to get struct member value!"));
			return FALSE;
		}
		//
		CWizXmlRpcValue* pMemberValue = NULL;
        if (!WizXmlRpcValueFromXml(nodeMemberValue, &pMemberValue))
		{
			TOLOG(_T("Failed to load struct member value from node!"));
			return FALSE;
		}
		//
		ATLASSERT(pMemberValue);
		//
		AddValue(strName, pMemberValue);
	}
	//
	return TRUE;
}
예제 #4
0
bool CWizXmlRpcStructValue::Read(CWizXMLNode& nodeValue)
{
	CWizXMLNode nodeStruct;
    if (!nodeValue.FindChildNode("struct", nodeStruct)) {
        TOLOG("Failed to get struct node!");
        return false;
	}

    std::deque<CWizXMLNode> arrayMember;
	nodeStruct.GetAllChildNodes(arrayMember);

    std::deque<CWizXMLNode>::iterator it;
    for (it = arrayMember.begin(); it != arrayMember.end(); it++)
    {
		CWizXMLNode& nodeMember = *it;

        QString strName;
        if (!nodeMember.GetChildNodeText("name", strName))
        {
            TOLOG("Failed to get struct member name!");
            return false;
		}

		CWizXMLNode nodeMemberValue;
        if (!nodeMember.FindChildNode("value", nodeMemberValue))
        {
            TOLOG("Failed to get struct member value!");
            return false;
		}

		CWizXmlRpcValue* pMemberValue = NULL;
        if (!WizXmlRpcValueFromXml(nodeMemberValue, &pMemberValue))
		{
            TOLOG("Failed to load struct member value from node!");
            return false;
		}

        Q_ASSERT(pMemberValue);

		AddValue(strName, pMemberValue);
	}

    return true;
}