]> Dogcows Code - chaz/yoink/blob - src/stlplus/strings/string_ntree.tpp
remove some deprected stuff
[chaz/yoink] / src / stlplus / strings / string_ntree.tpp
1 ////////////////////////////////////////////////////////////////////////////////
2
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
7
8 ////////////////////////////////////////////////////////////////////////////////
9
10 namespace stlplus
11 {
12
13 template<typename T, typename S>
14 std::string ntree_to_string(const ntree<T>& values,
15 S to_string_fn,
16 const std::string& separator,
17 const std::string& indent_string)
18 {
19 std::string result;
20 for (TYPENAME ntree<T>::const_prefix_iterator i = values.prefix_begin(); i != values.prefix_end(); i++)
21 {
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);
26 }
27 return result;
28 }
29
30 } // end namespace stlplus
31
This page took 0.036341 seconds and 4 git commands to generate.