rodecomp/Source/Resource/XmlNode.cpp
ragnarok-clanker 07897c8bea Maintenance: Annotation cleanup, no code change (resubmission of 10984). Every // FUNCTION: line now has // OFFSET: <its address from
Batch #11163 by ragnarok-clanker: no function's compiled code changes; checked with 226 compiled unit(s), including every includer of Source/Client/Application/UnhandledExceptionHandler.h, Source/Contents/ReputeMgrLoad.inl, Source/Render/RenderSystemBase.h, Source/UI/Lists/UIListBoxTemplate.h, Source/Utility/Async/NRecycleObject.h.
2026-11-04 21:29:46 +00:00

81 lines
1.6 KiB
C++

#include "Resource/XmlNode.h"
#include <cstdlib>
#include <cstring>
// OFFSET: 0x00AFA470
// FUNCTION: fn_18291
XmlNode::XmlNode(const char* name) : name(name), unknown_0004(0), unknown_0008(0), sibling(nullptr), child(nullptr) {
}
// OFFSET: 0x00AFA500
// FUNCTION: fn_18292
XmlNode::~XmlNode() {
this->Clear();
}
// OFFSET: 0x00AFA590
// FUNCTION: fn_18293
XmlNode* XmlNode::AppendSibling(XmlNode* node) {
XmlNode* current = this;
while (current->sibling != nullptr) {
current = current->sibling;
}
current->sibling = node;
return node;
}
// OFFSET: 0x00AFA5C0
// FUNCTION: fn_18294
void XmlDocument::Reset() {
this->Clear();
if (this->buffer != nullptr) {
std::free(this->buffer);
this->buffer = nullptr;
}
}
// OFFSET: 0x00AFA5F0
// FUNCTION: fn_18295
void XmlNode::Clear() {
if (this->sibling != nullptr) {
delete this->sibling;
this->sibling = nullptr;
}
if (this->child != nullptr) {
delete this->child;
this->child = nullptr;
}
this->unknown_0008 = 0;
this->unknown_0004 = 0;
}
// OFFSET: 0x00AFA6B0
// FUNCTION: fn_18296
XmlNode* XmlNode::FindChild(const char* name) {
XmlNode* first = this->child;
if (first == nullptr) {
return nullptr;
}
if (std::strcmp(first->name, name) == 0) {
return first;
}
return first->FindSibling(name);
}
// OFFSET: 0x00AFA710
// FUNCTION: fn_18297
XmlNode* XmlNode::FindSibling(const char* name) {
for (XmlNode* current = this->sibling; current != nullptr; current = current->sibling) {
if (std::strcmp(current->name, name) == 0) {
return current;
}
}
return nullptr;
}