1 ////////////////////////////////////////////////////////////////////////////////
3 // Author: Andy Rushton
4 // Copyright: (c) Southampton University 1999-2004
5 // (c) Andy Rushton 2004-2009
6 // License: BSD License, see ../docs/license.html
8 ////////////////////////////////////////////////////////////////////////////////
13 template<typename T, typename S>
14 std::string ntree_to_string(const ntree<T>& values,
16 const std::string& separator,
17 const std::string& indent_string)
20 for (TYPENAME ntree<T>::const_prefix_iterator i = values.prefix_begin(); i != values.prefix_end(); i++)
22 if (i != values.prefix_begin()) result += separator;
23 for (unsigned indent = values.depth(i.simplify()); --indent; )
24 result += indent_string;
25 result += to_string_fn(*i);
30 } // end namespace stlplus