X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fstlplus%2Fstrings%2Fstring_digraph.tpp;fp=src%2Fstlplus%2Fstrings%2Fstring_digraph.tpp;h=9fd63d54c1842cd3019204c4a9635ad86167f535;hb=6b0a0d0efafe34d48ab344fca3b479553bd4e62c;hp=0000000000000000000000000000000000000000;hpb=85783316365181491a3e3c0c63659972477cebba;p=chaz%2Fyoink diff --git a/src/stlplus/strings/string_digraph.tpp b/src/stlplus/strings/string_digraph.tpp new file mode 100644 index 0000000..9fd63d5 --- /dev/null +++ b/src/stlplus/strings/string_digraph.tpp @@ -0,0 +1,33 @@ +//////////////////////////////////////////////////////////////////////////////// + +// Author: Andy Rushton +// Copyright: (c) Southampton University 1999-2004 +// (c) Andy Rushton 2004-2009 +// License: BSD License, see ../docs/license.html + +//////////////////////////////////////////////////////////////////////////////// +#include "string_sequence.hpp" + +namespace stlplus +{ + + //////////////////////////////////////////////////////////////////////////////// + + template + std::string digraph_to_string(const digraph& values, + NS node_to_string_fn, + AS arc_to_string_fn, + const std::string& separator) + { + std::string result; + result += "nodes:"; + result += separator; + result += sequence_to_string(values.begin(), values.end(), node_to_string_fn, separator); + result += "arcs:"; + result += separator; + result += sequence_to_string(values.arc_begin(), values.arc_end(), arc_to_string_fn, separator); + return result; + } + +} // end namespace stlplus +