XPlor/libs/xassets/xpathnodetreeinfo.cpp

54 lines
1005 B
C++
Raw Normal View History

2025-08-17 13:14:17 -04:00
#include "xpathnodetreeinfo.h"
2025-09-05 18:35:17 -04:00
#include "xpathnodetree.h"
2025-08-17 13:14:17 -04:00
XPathNodeTreeInfo::XPathNodeTreeInfo()
2025-09-05 18:35:17 -04:00
: XAsset()
, mChildren()
, mNodes()
{
}
XPathNodeTreeInfo::~XPathNodeTreeInfo()
{
2025-08-17 13:14:17 -04:00
}
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) {
2025-09-05 18:35:17 -04:00
qint32 treePtr;
*aStream >> treePtr;
if (treePtr == -1)
{
}
2025-08-17 13:14:17 -04:00
}
}
}
2025-09-05 18:35:17 -04:00
XPathNodeTree *XPathNodeTreeInfo::GetChild(int index) const {
2025-08-17 13:14:17 -04:00
if (index >= 0 && index < 2) {
return mChildren[index];
}
return nullptr;
}
2025-09-05 18:35:17 -04:00
void XPathNodeTreeInfo::SetChild(int index, XPathNodeTree *child) {
2025-08-17 13:14:17 -04:00
if (index >= 0 && index < 2) {
mChildren[index] = child;
}
}
const XPathNodeTreeNodes& XPathNodeTreeInfo::GetNodes() const {
return mNodes;
}
void XPathNodeTreeInfo::SetNodes(const XPathNodeTreeNodes& nodes) {
mNodes = nodes;
}