void save(file& fp, unsigned depth = 0) { for(auto& child : children) { if(child.desc) { for(unsigned n = 0; n < depth; n++) fp.print(" "); fp.print("//", child.desc, "\n"); } for(unsigned n = 0; n < depth; n++) fp.print(" "); fp.print(child.name); if(!child.empty()) fp.print(": ", child.get()); fp.print("\n"); child.save(fp, depth + 1); if(depth == 0) fp.print("\n"); } }
template<typename... Args> void print(Args&&... args) { fp.print(std::forward<Args>(args)...); }