47 lines
896 B
C++
47 lines
896 B
C++
|
|
|
|
|
|
|
|
|
|
|
|
#include "xpathnodetreeinfo.h"
|
|
|
|
XPathNodeTreeInfo::XPathNodeTreeInfo()
|
|
: XAsset() {
|
|
}
|
|
|
|
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) {
|
|
// Skip reading pointers directly from the stream
|
|
aStream->ignore(sizeof(PathNodeTree*));
|
|
}
|
|
}
|
|
}
|
|
|
|
PathNodeTree* XPathNodeTreeInfo::GetChild(int index) const {
|
|
if (index >= 0 && index < 2) {
|
|
return mChildren[index];
|
|
}
|
|
return nullptr;
|
|
}
|
|
|
|
void XPathNodeTreeInfo::SetChild(int index, PathNodeTree* child) {
|
|
if (index >= 0 && index < 2) {
|
|
mChildren[index] = child;
|
|
}
|
|
}
|
|
|
|
const XPathNodeTreeNodes& XPathNodeTreeInfo::GetNodes() const {
|
|
return mNodes;
|
|
}
|
|
|
|
void XPathNodeTreeInfo::SetNodes(const XPathNodeTreeNodes& nodes) {
|
|
mNodes = nodes;
|
|
}
|
|
|
|
|
|
|
|
|