]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/std-string.hh
6c83bc526fb923e473128e96d318f0fceb0660a4
[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 /* Also declare string, in the wrong way.  */
15 #include <algorithm>
16 #include <iostream>
17 #include <sstream>
18
19 #endif
20
21
22
23 #include "compare.hh"
24
25 #if STD_STRING
26 #include <string>
27 #endif
28
29 #if STD_STRING
30
31 namespace std {
32
33   typedef size_t ssize;
34 #define NPOS std::string::npos
35   // typedef string std::string;
36 }
37
38 #else /* ! STD_STRING */
39
40 namespace std {
41
42 #define string String
43   using namespace std;
44   class String;
45   typedef int ssize;
46 #define NPOS -1
47 }
48
49 #include "string.hh"
50
51 #endif /* STD_STRING */
52
53 namespace std {
54
55   std::string to_string (std::string s);
56   std::string to_string (char c, int n = 1);
57   std::string to_string (int i, char const *format = 0);
58   std::string to_string (double f, char const *format = 0);
59   std::string to_string (long b);
60   std::string to_string (bool b);
61   std::string to_string (char const *format, ...);
62   
63   std::string &replace_all (std::string &str, std::string find, std::string replace);
64   std::string &replace_all (std::string &str, char find, char replace);
65   char *string_copy (std::string s);
66   
67   int string_compare (std::string const &, std::string const &);
68   INSTANTIATE_COMPARE (std::string const &, string_compare);
69 }
70
71 #endif /* STD_STRING_HH */