Hayden Hargreaves 95e9644149 (FEATURE): Implemented operator overloading.
Overloaded '<<' in the Node class to allow simpler output.
2025-10-29 15:46:37 -07:00

27 lines
521 B
C++

#include "node.h"
#include <iostream>
#include <memory>
void Node::Inspect(int indent) {
if (this->children.size() > 0) {
for (int i = 0; i <= indent; i++) {
std::cout << "\t";
}
std::cout << "std::vector<Node> children: " << std::endl;
}
for (const auto &child : this->children) {
for (int i = 0; i <= indent; i++) {
std::cout << "\t";
}
child->Inspect(indent + 1);
}
}
std::ostream &operator<<(std::ostream &os, Node const &node) {
os << node.ToHtml();
return os;
}