27 lines
521 B
C++
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;
|
|
}
|