X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Finclude%2Fstd-string.hh;h=8ae6dfa5af5cbbf8846ac019ca46103df3484c82;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=4cefb799534c19286ee40c6cd9f7e2f3b1c24f0d;hpb=bf898a6f737ebdd6a749ea0a14d1056a3566a10e;p=lilypond.git diff --git a/flower/include/std-string.hh b/flower/include/std-string.hh index 4cefb79953..8ae6dfa5af 100644 --- a/flower/include/std-string.hh +++ b/flower/include/std-string.hh @@ -1,66 +1,52 @@ /* - std-string.hh -- declare Std_string + std-string.hh -- declare string source file of the GNU LilyPond music typesetter - (c) 2006 Jan Nieuwenhuizen + (c) 2006--2008 Jan Nieuwenhuizen */ #ifndef STD_STRING_HH #define STD_STRING_HH + +#include "compare.hh" +#include "flower-proto.hh" -#if !STD_STRING - -#define Std_string String -#define to_std_string to_string -class String; -typedef int ssize; -#define NPOS -1 - -#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 -using namespace std; -typedef size_t ssize; -#define NPOS std::string::npos - -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 +using namespace std; - //operator Std_string (String const&); +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); - 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, ...); +int string_compare (string const &, string const &); -#endif /* STD_STRING */ +INSTANTIATE_COMPARE (string const &, string_compare); - Std_string &replace_all (Std_string &str, Std_string find, Std_string replace); -#if STD_STRING -} -#endif - #endif /* STD_STRING_HH */