From 98b403114c3d9edcb6b74938f07c68dccc3c2489 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Sat, 12 Mar 2011 14:03:34 -0500 Subject: 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. --- cores/arduino/WString.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'cores/arduino/WString.h') 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 -- cgit v1.2.3-18-g5258