1
1
/*
2
- Copyright (c) 2014 Arduino. All right reserved.
2
+ WString.h - String library for Wiring & Arduino
3
+ ...mostly rewritten by Paul Stoffregen...
4
+ Copyright (c) 2009-10 Hernando Barragan. All right reserved.
5
+ Copyright 2011, Paul Stoffregen, [email protected]
3
6
4
7
This library is free software; you can redistribute it and/or
5
8
modify it under the terms of the GNU Lesser General Public
8
11
9
12
This library is distributed in the hope that it will be useful,
10
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
- See the GNU Lesser General Public License for more details.
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ Lesser General Public License for more details.
13
16
14
17
You should have received a copy of the GNU Lesser General Public
15
18
License along with this library; if not, write to the Free Software
@@ -56,7 +59,7 @@ class String
56
59
String (const char *cstr = " " );
57
60
String (const String &str);
58
61
String (const __FlashStringHelper *str);
59
- # ifdef __GXX_EXPERIMENTAL_CXX0X__
62
+ # if __cplusplus >= 201103L || defined( __GXX_EXPERIMENTAL_CXX0X__)
60
63
String (String &&rval);
61
64
String (StringSumHelper &&rval);
62
65
#endif
@@ -78,21 +81,21 @@ class String
78
81
inline unsigned int length (void ) const {return len;}
79
82
80
83
// creates a copy of the assigned value. if the value is null or
81
- // invalid, or if the memory allocation fails, the string will be
84
+ // invalid, or if the memory allocation fails, the string will be
82
85
// marked as invalid ("if (s)" will be false).
83
86
String & operator = (const String &rhs);
84
87
String & operator = (const char *cstr);
85
88
String & operator = (const __FlashStringHelper *str);
86
- # ifdef __GXX_EXPERIMENTAL_CXX0X__
89
+ # if __cplusplus >= 201103L || defined( __GXX_EXPERIMENTAL_CXX0X__)
87
90
String & operator = (String &&rval);
88
91
String & operator = (StringSumHelper &&rval);
89
92
#endif
90
93
91
94
// concatenate (works w/ built-in types)
92
-
95
+
93
96
// returns true on success, false on failure (in which case, the string
94
- // is left unchanged). if the argument is null or invalid, the
95
- // concatenation is considered unsucessful.
97
+ // is left unchanged). if the argument is null or invalid, the
98
+ // concatenation is considered unsucessful.
96
99
unsigned char concat (const String &str);
97
100
unsigned char concat (const char *cstr);
98
101
unsigned char concat (char c);
@@ -104,7 +107,7 @@ class String
104
107
unsigned char concat (float num);
105
108
unsigned char concat (double num);
106
109
unsigned char concat (const __FlashStringHelper * str);
107
-
110
+
108
111
// if there's not enough memory for the concatenated value, the string
109
112
// will be left unchanged (but this isn't signalled in any way)
110
113
String & operator += (const String &rhs) {concat (rhs); return (*this );}
@@ -197,7 +200,7 @@ class String
197
200
// copy and move
198
201
String & copy (const char *cstr, unsigned int length);
199
202
String & copy (const __FlashStringHelper *pstr, unsigned int length);
200
- # ifdef __GXX_EXPERIMENTAL_CXX0X__
203
+ # if __cplusplus >= 201103L || defined( __GXX_EXPERIMENTAL_CXX0X__)
201
204
void move (String &rhs);
202
205
#endif
203
206
};
0 commit comments