diff options
author | David A. Mellis <d.mellis@arduino.cc> | 2011-03-12 14:03:34 -0500 |
---|---|---|
committer | David A. Mellis <d.mellis@arduino.cc> | 2011-03-12 14:03:34 -0500 |
commit | 98b403114c3d9edcb6b74938f07c68dccc3c2489 (patch) | |
tree | c06ccbfd60627341d42ac66cecb2dcf35faade5e /cores/arduino/WString.h | |
parent | b4b32f60f1c156e76117dab69479c193a861be23 (diff) |
Modifying String.concat() to return success or failure, not this.
Which means you can't chain multiple concat() calls together, but you can check if they succeeded or not.
Diffstat (limited to 'cores/arduino/WString.h')
-rw-r--r-- | cores/arduino/WString.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/cores/arduino/WString.h b/cores/arduino/WString.h index 164eeac..f797861 100644 --- a/cores/arduino/WString.h +++ b/cores/arduino/WString.h @@ -73,22 +73,22 @@ public: String & operator = (char c); // concat - String & concat(const String &str); - String & concat(const char *cstr); - String & concat(char c); - String & concat(unsigned char c) {return concat((char)c);} - String & concat(int num); - String & concat(unsigned int num); - String & concat(long num); - String & concat(unsigned long num); - String & operator += (const String &rhs) {return concat(rhs);} - String & operator += (const char *cstr) {return concat(cstr);} - String & operator += (char c) {return concat(c);} - String & operator += (unsigned char c) {return concat((char)c);} - String & operator += (int num) {return concat(num);} - String & operator += (unsigned int num) {return concat(num);} - String & operator += (long num) {return concat(num);} - String & operator += (unsigned long num) {return concat(num);} + unsigned char concat(const String &str); + unsigned char concat(const char *cstr); + unsigned char concat(char c); + unsigned char concat(unsigned char c) {return concat((char)c);} + unsigned char concat(int num); + unsigned char concat(unsigned int num); + unsigned char concat(long num); + unsigned char concat(unsigned long num); + String & operator += (const String &rhs) {concat(rhs); return (*this);} + String & operator += (const char *cstr) {concat(cstr); return (*this);} + String & operator += (char c) {concat(c); return (*this);} + String & operator += (unsigned char c) {concat((char)c); return (*this);} + String & operator += (int num) {concat(num); return (*this);} + String & operator += (unsigned int num) {concat(num); return (*this);} + String & operator += (long num) {concat(num); return (*this);} + String & operator += (unsigned long num) {concat(num); return (*this);} // concatenate friend StringSumHelper & operator + (const StringSumHelper &lhs, const String &rhs); @@ -156,7 +156,7 @@ protected: protected: void init(void); unsigned char changeBuffer(unsigned int maxStrLen); - String & concat(const char *cstr, unsigned int length); + unsigned char concat(const char *cstr, unsigned int length); }; class StringSumHelper : public String |