2 std-tring.cc -- implement external interface for Std_String
4 source file of the GNU LilyPond music typesetter
6 (c) 2006 Jan Nieuwenhuizen <janneke@gnu.org>
9 #include "std-string.hh"
15 to_std_string (char c, int n)
17 /* FIXME, remove this function and use std::string interface for
18 String? This interface is a bit clumsy, almost alway you want
20 return Std_string (n, c);
23 #define FIND_FAILED string::npos
25 #else /* !STD_STRING */
27 #define FIND_FAILED -1
30 #endif /* STD_STRING */
33 replace_all (Std_string &str, Std_string find, Std_string replace)
35 int len = find.length ();
36 for (SIZE_T i = str.find (find); i != FIND_FAILED; i = str.find (find,
38 str = str.replace (i, len, replace);