X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Fstd-string.cc;h=285c51883c5d1fc0a7727816a3e99ab0e5da2e03;hb=a9857ea8e9f54cdb3b1b31fc558515225ca36564;hp=1221609c6c0ce4bc2e76a140d4fcbb1ed35f3d11;hpb=e7c33f14dc0ae7b43b21db16fd0ce48934049a57;p=lilypond.git diff --git a/flower/std-string.cc b/flower/std-string.cc index 1221609c6c..285c51883c 100644 --- a/flower/std-string.cc +++ b/flower/std-string.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 2006--2007 Jan Nieuwenhuizen + (c) 2006--2009 Jan Nieuwenhuizen */ #include "std-string.hh" @@ -57,6 +57,12 @@ to_string (unsigned u) return String_convert::unsigned_string (u); } +string +to_string (I64 b, char const *format) +{ + return String_convert::i64_string (b, format); +} + string to_string (char const *format, ...) { @@ -71,20 +77,20 @@ to_string (char const *format, ...) TODO: this O(n^2) in #occurences of find, due to repeated copying. */ string & -replace_all (string &str, string find, string replace) +replace_all (string *str, string const &find, string const &replace) { ssize len = find.length (); - for (ssize i = str.find (find); i != NPOS; i = str.find (find, i + len)) - str = str.replace (i, len, replace); - return str; + for (ssize i = str->find (find); i != NPOS; i = str->find (find, i + len)) + *str = str->replace (i, len, replace); + return *str; } string & -replace_all (string &str, char find, char replace) +replace_all (string *str, char find, char replace) { - for (ssize i = str.find (find); i != NPOS; i = str.find (find, i + 1)) - str[i] = replace; - return str; + for (ssize i = str->find (find); i != NPOS; i = str->find (find, i + 1)) + (*str)[i] = replace; + return *str; } char *