X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=flower%2Finclude%2Fstd-string.hh;h=fc4a1d17452304f8ccd1aea733332418e2c24fd0;hb=d70b0b408466d4b6992878b2bf11e8b222961472;hp=129cf4dfc7747eb1b7d445619a92858bcabd74f0;hpb=d24e58ca5b51877dff138fad2383470707b51a0d;p=lilypond.git diff --git a/flower/include/std-string.hh b/flower/include/std-string.hh index 129cf4dfc7..fc4a1d1745 100644 --- a/flower/include/std-string.hh +++ b/flower/include/std-string.hh @@ -1,53 +1,63 @@ /* - std-string.hh -- declare Std_string + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2006--2011 Jan Nieuwenhuizen - (c) 2006 Jan Nieuwenhuizen + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #ifndef STD_STRING_HH #define STD_STRING_HH + +#include "compare.hh" +#include "flower-proto.hh" -#if !STD_STRING - -#define Std_string -#define to_std_string to_string -#include "string.hh" - -#else +#if 0 +/* + leads to dubious crashes - libstdc++ bug? + */ +#ifndef NDEBUG +#define _GLIBCXX_DEBUG 1 +#endif +#endif #include -// #warning Using std::string -namespace std { +using namespace std; -#if 0 - class Std_string : public string - { - public: - Std_string (); - Std_string (char const*); - Std_string (Std_string const&, int pos, int n=npos); - ///Std_string (String const&, int pos, int n); - ////Std_string (String const &); - ////operator String (); - }; -#else - typedef string Std_string; -#endif +typedef size_t ssize; +#define NPOS string::npos + +string to_string (string s); +string to_string (char c, int n=1); +string to_string (int i, char const *format=0); +string to_string (double f, char const *format=0); +string to_string (long); +string to_string (long unsigned); +string to_string (I64, char const *format=0); +string to_string (unsigned); +string to_string (bool b); +string to_string (char const *format, ...) + __attribute__ ((format (printf, 1, 2))); + +string &replace_all (string* str, string const &find, string const &replace); +string &replace_all (string* str, char find, char replace); +char *string_copy (string s); - //operator Std_string (String const&); +int string_compare (string const &, string const &); - Std_string to_std_string (Std_string s); - Std_string to_std_string (char c, int n = 1); - Std_string to_std_string (int i, char const *format = 0); - Std_string to_std_string (double f, char const *format = 0); - Std_string to_std_string (long b); - Std_string to_std_string (bool b); - Std_string to_std_string (char const *format, ...); -} +INSTANTIATE_COMPARE (string const &, string_compare); -#endif /* STD_STRING */ #endif /* STD_STRING_HH */