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