]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/std-string.hh
* flower/include/std-string.hh: String/std::string compatibility:
[lilypond.git] / flower / include / std-string.hh
1 /*
2   std-string.hh -- declare Std_string
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2006 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
8
9 #ifndef STD_STRING_HH
10 #define STD_STRING_HH
11
12 #if !STD_STRING
13
14 #define Std_string String
15 #define to_std_string to_string
16 class String;
17 typedef int ssize;
18 #define NPOS -1
19
20 #include "string.hh"
21
22 #else
23
24 #include <string>
25 // #warning Using std::string
26 using namespace std;
27 typedef size_t ssize;
28
29 #define NPOS std::string::npos
30
31 namespace std {
32
33 #if 0
34   class Std_string : public string
35   {
36   public:
37     Std_string ();
38     Std_string (char const*);
39     Std_string (Std_string const&, int pos, int n=npos);
40     ///Std_string (String const&, int pos, int n);
41     ////Std_string (String const &);
42     ////operator String ();
43   };
44 #else  
45   typedef string Std_string;
46 #endif
47
48   //operator Std_string (String const&);
49
50   Std_string to_std_string (Std_string s);
51   Std_string to_std_string (char c, int n = 1);
52   Std_string to_std_string (int i, char const *format = 0);
53   Std_string to_std_string (double f, char const *format = 0);
54   Std_string to_std_string (long b);
55   Std_string to_std_string (bool b);
56   Std_string to_std_string (char const *format, ...);
57
58 #endif /* STD_STRING */
59
60   Std_string &replace_all (Std_string &str, Std_string find, Std_string replace);
61 #if STD_STRING
62 }
63 #endif
64   
65
66 #endif /* STD_STRING_HH */