Lines Matching refs:string
21 #include <string.h>
28 class string;
30 inline string operator+(const string &, const string &);
31 inline string operator+(const string &, const char *);
32 inline string operator+(const char *, const string &);
33 inline string operator+(const string &, char);
34 inline string operator+(char, const string &);
35 inline int operator==(const string &, const string &);
36 inline int operator!=(const string &, const string &);
38 class string {
40 string();
41 string(const string &);
42 string(const char *);
43 string(const char *, int);
44 string(char);
46 ~string();
48 string &operator=(const string &);
49 string &operator=(const char *);
50 string &operator=(char);
52 string &operator+=(const string &);
53 string &operator+=(const char *);
54 string &operator+=(char);
61 string substring(int i, int n) const;
72 void move(string &);
74 friend string operator+(const string &, const string &);
75 friend string operator+(const string &, const char *);
76 friend string operator+(const char *, const string &);
77 friend string operator+(const string &, char);
78 friend string operator+(char, const string &);
80 friend int operator==(const string &, const string &);
81 friend int operator!=(const string &, const string &);
82 friend int operator<=(const string &, const string &);
83 friend int operator<(const string &, const string &);
84 friend int operator>=(const string &, const string &);
85 friend int operator>(const string &, const string &);
92 string(const char *, int, const char *, int); // for use by operator+
97 inline char &string::operator[](int i)
103 inline char string::operator[](int i) const
109 inline int string::length() const
114 inline int string::empty() const
119 inline int string::operator*() const
124 inline const char *string::contents() const
129 inline string operator+(const string &s1, const string &s2)
131 return string(s1.ptr, s1.len, s2.ptr, s2.len);
134 inline string operator+(const string &s1, const char *s2)
140 return string(s1.ptr, s1.len, s2, strlen(s2));
142 return s2 == 0 ? s1 : string(s1.ptr, s1.len, s2, strlen(s2));
146 inline string operator+(const char *s1, const string &s2)
152 return string(s1, strlen(s1), s2.ptr, s2.len);
154 return s1 == 0 ? s2 : string(s1, strlen(s1), s2.ptr, s2.len);
158 inline string operator+(const string &s, char c)
160 return string(s.ptr, s.len, &c, 1);
163 inline string operator+(char c, const string &s)
165 return string(&c, 1, s.ptr, s.len);
168 inline int operator==(const string &s1, const string &s2)
174 inline int operator!=(const string &s1, const string &s2)
180 inline string string::substring(int i, int n) const
183 return string(ptr + i, n);
186 inline string &string::operator+=(char c)
194 void put_string(const string &, FILE *);
196 string as_string(int);