+////////////////////////////////////////////////////////////////////////////////\r
+\r
+// Author: Andy Rushton\r
+// Copyright: (c) Southampton University 1999-2004\r
+// (c) Andy Rushton 2004-2009\r
+// License: BSD License, see ../docs/license.html\r
+\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace stlplus\r
+{\r
+\r
+ template<typename T, typename S>\r
+ void print_ntree(std::ostream& device,\r
+ const ntree<T>& values,\r
+ S print_fn,\r
+ const std::string& separator,\r
+ const std::string& indent_string)\r
+ {\r
+ for (TYPENAME ntree<T>::const_prefix_iterator i = values.prefix_begin(); i != values.prefix_end(); i++)\r
+ {\r
+ if (i != values.prefix_begin()) device << separator;\r
+ for (unsigned indent = values.depth(i.simplify()); --indent; )\r
+ device << indent_string;\r
+ print_fn(device, *i);\r
+ }\r
+ }\r
+\r
+} // end namespace stlplus\r
+\r