#include "xpathnodetreeinfo.h"
#include "xpathnodetree.h"

XPathNodeTreeInfo::XPathNodeTreeInfo()
    : XAsset()
    , mChildren()
    , mNodes()
{
}

XPathNodeTreeInfo::~XPathNodeTreeInfo()
{

}

void XPathNodeTreeInfo::ParseData(QDataStream *aStream) {
    if (GetPtr() == -1) {
        // We'll assume we're parsing as children by default
        for (int i = 0; i < 2; ++i) {
            qint32 treePtr;
            *aStream >> treePtr;
            if (treePtr == -1)
            {

            }
        }
    }
}

XPathNodeTree *XPathNodeTreeInfo::GetChild(int index) const {
    if (index >= 0 && index < 2) {
        return mChildren[index];
    }
    return nullptr;
}

void XPathNodeTreeInfo::SetChild(int index, XPathNodeTree *child) {
    if (index >= 0 && index < 2) {
        mChildren[index] = child;
    }
}

const XPathNodeTreeNodes& XPathNodeTreeInfo::GetNodes() const {
    return mNodes;
}

void XPathNodeTreeInfo::SetNodes(const XPathNodeTreeNodes& nodes) {
    mNodes = nodes;
}




