diff options
author | David A. Mellis <d.mellis@arduino.cc> | 2011-03-11 18:01:40 -0500 |
---|---|---|
committer | David A. Mellis <d.mellis@arduino.cc> | 2011-03-11 18:01:40 -0500 |
commit | 22786eaed2494bf6fcd9b934f857dec1202b3148 (patch) | |
tree | d1992959631ec8c6c1215e4e0bf6fe588ecbad78 /cores/arduino/WString.cpp | |
parent | 438bca3cb270b0d882b6b3b0bc42d57d72307c76 (diff) |
Removing F("string") syntax for now.
We should probably add something like this back in later, but I want to do one thing at a time. This removes the __FlashStringHelper class as well.
Diffstat (limited to 'cores/arduino/WString.cpp')
-rw-r--r-- | cores/arduino/WString.cpp | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/cores/arduino/WString.cpp b/cores/arduino/WString.cpp index c980e24..b988acc 100644 --- a/cores/arduino/WString.cpp +++ b/cores/arduino/WString.cpp @@ -32,12 +32,6 @@ String::String(const char *cstr) if (cstr) copy(cstr, strlen(cstr)); } -String::String(const __FlashStringHelper *pgmstr) -{ - init(); - *this = pgmstr; -} - String::String(const String &value) { init(); @@ -163,22 +157,6 @@ String & String::copy(const char *cstr, unsigned int length) return *this; } -String & String::copy(const __FlashStringHelper *pgmstr) -{ - unsigned int length = strlen_P((const prog_char *)pgmstr); - if (!reserve(length)) { - if (buffer) { - free(buffer); - buffer = NULL; - } - len = capacity = 0; - return *this; - } - len = length; - strcpy_P(buffer, (const prog_char *)pgmstr); - return *this; -} - void String::move(String &rhs) { if (buffer) { @@ -229,12 +207,6 @@ String & String::operator = (const char *cstr) return *this; } -String & String::operator = (const __FlashStringHelper *pgmstr) -{ - copy(pgmstr); - return *this; -} - String & String::operator = (char c) { char buf[2]; @@ -267,16 +239,6 @@ String & String::append(const char *cstr) return *this; } -String & String::append(const __FlashStringHelper *pgmstr) -{ - unsigned int length = strlen_P((const prog_char *)pgmstr); - unsigned int newlen = len + length; - if (length == 0 || !reserve(newlen)) return *this; - strcpy_P(buffer + len, (const prog_char *)pgmstr); - len = newlen; - return *this; -} - String & String::append(char c) { char buf[2]; @@ -336,13 +298,6 @@ StringSumHelper & operator + (const StringSumHelper &lhs, const char *cstr) return a; } -StringSumHelper & operator + (const StringSumHelper &lhs, const __FlashStringHelper *pgmstr) -{ - StringSumHelper &a = const_cast<StringSumHelper&>(lhs); - a.append(pgmstr); - return a; -} - StringSumHelper & operator + (const StringSumHelper &lhs, char c) { StringSumHelper &a = const_cast<StringSumHelper&>(lhs); @@ -411,12 +366,6 @@ unsigned char String::equals(const char *cstr) const return strcmp(buffer, cstr) == 0; } -unsigned char String::equals(const __FlashStringHelper *pgmstr) const -{ - if (len == 0) return pgm_read_byte(pgmstr) == 0; - return strcmp_P(buffer, (const prog_char *)pgmstr) == 0; -} - unsigned char String::operator<(const String &rhs) const { return compareTo(rhs) < 0; |