X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Finclude%2Fstd-string.hh;h=0a34d0504958c7fbe4ef8b05dae11b313d226321;hb=b872748c6aa8bb721ced458691b38ac2fac5dfc8;hp=7d2ae6d7cc3ad2552255d18f86824c9f10fcc4f4;hpb=9d4a5bbc9687aef811a60aabd9cb839412984e96;p=lilypond.git diff --git a/flower/include/std-string.hh b/flower/include/std-string.hh index 7d2ae6d7cc..0a34d05049 100644 --- a/flower/include/std-string.hh +++ b/flower/include/std-string.hh @@ -1,74 +1,57 @@ /* - 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--2015 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 -#if !STD_STRING - -/* Also declare string, in the wrong way. */ -#include -#include -#include +#include "flower-proto.hh" +#if 0 +/* + leads to dubious crashes - libstdc++ bug? + */ +#ifdef DEBUG +#define _GLIBCXX_DEBUG 1 #endif - - -#include "compare.hh" - -#if STD_STRING -#include #endif -#if STD_STRING - -namespace std { - - typedef size_t ssize; -#define NPOS std::string::npos - -} - -#else /* ! STD_STRING */ - -namespace std { - -#define string String - using namespace std; - class String; - typedef int ssize; -#define NPOS -1 - -} - -#include "string.hh" - -#endif /* ! STD_STRING */ - -namespace std { - - 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 (unsigned); - string to_string (bool b); - string to_string (char const *format, ...); - - string &replace_all (string &str, string find, string replace); - string &replace_all (string &str, char find, char replace); - char *string_copy (string s); - - int string_compare (string const &, string const &); - - INSTANTIATE_COMPARE (string const &, string_compare); -} +#include +using namespace std; + +typedef size_t ssize; +#define NPOS string::npos + +string to_string (const string&); +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 (const string &s); #endif /* STD_STRING_HH */