11/*
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, paul@pjrc.com
36
47 This library is free software; you can redistribute it and/or
58 modify it under the terms of the GNU Lesser General Public
811
912 This library is distributed in the hope that it will be useful,
1013 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.
1316
1417 You should have received a copy of the GNU Lesser General Public
1518 License along with this library; if not, write to the Free Software
@@ -56,7 +59,7 @@ class String
5659 String (const char *cstr = " " );
5760 String (const String &str);
5861 String (const __FlashStringHelper *str);
59- # ifdef __GXX_EXPERIMENTAL_CXX0X__
62+ # if __cplusplus >= 201103L || defined( __GXX_EXPERIMENTAL_CXX0X__)
6063 String (String &&rval);
6164 String (StringSumHelper &&rval);
6265 #endif
@@ -78,21 +81,21 @@ class String
7881 inline unsigned int length (void ) const {return len;}
7982
8083 // 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
8285 // marked as invalid ("if (s)" will be false).
8386 String & operator = (const String &rhs);
8487 String & operator = (const char *cstr);
8588 String & operator = (const __FlashStringHelper *str);
86- # ifdef __GXX_EXPERIMENTAL_CXX0X__
89+ # if __cplusplus >= 201103L || defined( __GXX_EXPERIMENTAL_CXX0X__)
8790 String & operator = (String &&rval);
8891 String & operator = (StringSumHelper &&rval);
8992 #endif
9093
9194 // concatenate (works w/ built-in types)
92-
95+
9396 // 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.
9699 unsigned char concat (const String &str);
97100 unsigned char concat (const char *cstr);
98101 unsigned char concat (char c);
@@ -104,7 +107,7 @@ class String
104107 unsigned char concat (float num);
105108 unsigned char concat (double num);
106109 unsigned char concat (const __FlashStringHelper * str);
107-
110+
108111 // if there's not enough memory for the concatenated value, the string
109112 // will be left unchanged (but this isn't signalled in any way)
110113 String & operator += (const String &rhs) {concat (rhs); return (*this );}
@@ -197,7 +200,7 @@ class String
197200 // copy and move
198201 String & copy (const char *cstr, unsigned int length);
199202 String & copy (const __FlashStringHelper *pstr, unsigned int length);
200- # ifdef __GXX_EXPERIMENTAL_CXX0X__
203+ # if __cplusplus >= 201103L || defined( __GXX_EXPERIMENTAL_CXX0X__)
201204 void move (String &rhs);
202205 #endif
203206};
0 commit comments