29 if (cstr !=
NULL)
copy(cstr, strlen(cstr));
70 char buf[1 + 8 *
sizeof(
unsigned char)];
71 utoa(value, buf, base);
78 char buf[2 + 8 *
sizeof(int)];
79 itoa(value, buf, base);
86 char buf[1 + 8 *
sizeof(
unsigned int)];
87 utoa(value, buf, base);
94 char buf[2 + 8 *
sizeof(long)];
95 ltoa(value, buf, base);
102 char buf[1 + 8 *
sizeof(
unsigned long)];
103 ultoa(value, buf, base);
111 *
this = dtostrf(value, (decimalPlaces + 2), decimalPlaces, buf);
118 *
this = dtostrf(value, (decimalPlaces + 2), decimalPlaces, buf);
155 char* newbuffer = (
char*) realloc(
m_buffer, maxStrLen + 1);
156 if (newbuffer ==
NULL)
return (
false);
211 if (
this == &rhs)
return (*
this);
223 if (
this != &rval)
move(rval);
230 if (
this != &rval)
move(rval);
238 if (cstr !=
NULL)
copy(cstr, strlen(cstr));
261 if (cstr ==
NULL)
return (
false);
262 if (length == 0)
return (
true);
263 if (!
reserve(newlen))
return (
false);
272 if (cstr ==
NULL)
return (
false);
273 return (
concat(cstr, strlen(cstr)));
288 char buf[1 + 3 *
sizeof(
unsigned char)];
290 return (
concat(buf, strlen(buf)));
296 char buf[2 + 3 *
sizeof(int)];
298 return (
concat(buf, strlen(buf)));
304 char buf[1 + 3 *
sizeof(
unsigned int)];
306 return (
concat(buf, strlen(buf)));
312 char buf[2 + 3 *
sizeof(long)];
314 return (
concat(buf, strlen(buf)));
320 char buf[1 + 3 *
sizeof(
unsigned long)];
322 return (
concat(buf, strlen(buf)));
329 char*
string = dtostrf(num, 4, 2, buf);
330 return (
concat(
string, strlen(
string)));
337 char*
string = dtostrf(num, 4, 2, buf);
338 return (
concat(
string, strlen(
string)));
344 if (str ==
NULL)
return (
false);
346 if (length == 0)
return (
true);
348 if (!
reserve(newlen))
return (
false);
447 return (0 - *(
unsigned char*) s.
m_buffer);
449 return (*(
unsigned char*)
m_buffer);
465 return ((cstr ==
NULL) || (*cstr == 0));
468 return (strcmp(
m_buffer, cstr) == 0);
498 if (
this == &s2)
return (
true);
504 if (tolower(*p1++) != tolower(*p2++))
return (
false);
537 return (
operator[](loc));
549 static char dummy_writable_char;
551 dummy_writable_char = 0;
552 return (dummy_writable_char);
567 if ((bufsize == 0) || (buf ==
NULL))
return;
572 unsigned int n = bufsize - 1;
574 strncpy((
char*) buf,
m_buffer + index, n);
587 if (fromIndex >=
m_length)
return -1;
588 const char* temp = strchr(
m_buffer + fromIndex, ch);
589 if (temp ==
NULL)
return (-1);
602 if (fromIndex >=
m_length)
return (-1);
604 if (found ==
NULL)
return (-1);
617 if (fromIndex >=
m_length)
return (-1);
618 char tempchar =
m_buffer[fromIndex + 1];
620 char* temp = strrchr(
m_buffer, ch );
622 if (temp ==
NULL)
return (-1);
642 if (p ==
NULL)
break;
652 unsigned int temp = right;
670 for (
char* p =
m_buffer; *p != 0; p++) {
683 while ((foundAt = strstr(readFrom, find.
m_buffer)) !=
NULL) {
685 readFrom = foundAt + replace.
m_length;
687 }
else if (diff < 0) {
689 while ((foundAt = strstr(readFrom, find.
m_buffer)) !=
NULL) {
690 unsigned int n = foundAt - readFrom;
691 memcpy(writeTo, readFrom, n);
698 strcpy(writeTo, readFrom);
701 while ((foundAt = strstr(readFrom, find.
m_buffer)) !=
NULL) {
708 while ((index >= 0) && ((index =
lastIndexOf(find, index)) >= 0)) {
723 remove(index, count);
730 if (count == 0)
return;
761 while (isspace(*begin)) begin++;
763 while (isspace(*end) && end >= begin) end--;
764 m_length = end + 1 - begin;
unsigned char equalsIgnoreCase(const String &s) const
char charAt(unsigned int index) const
String substring(unsigned int beginIndex, unsigned int endIndex) const
int compareTo(const String &s) const
float toFloat(void) const
int lastIndexOf(char ch) const
unsigned char equals(const String &s) const
unsigned char changeBuffer(unsigned int maxStrLen)
String & operator=(const String &rhs)
unsigned char operator>=(const String &rhs) const
unsigned char reserve(unsigned int size)
unsigned char operator<=(const String &rhs) const
unsigned int m_capacity
the array length minus one (for the '\0')
char operator[](unsigned int index) const
String & copy(const char *cstr, unsigned int length)
void getBytes(unsigned char *buf, unsigned int bufsize, unsigned int index=0) const
String(const char *cstr="")
unsigned int length(void) const
void remove(unsigned int index)
unsigned char operator<(const String &rhs) const
const class prog_str * str_P
void setCharAt(unsigned int index, char c)
unsigned char endsWith(const String &suffix) const
char * strcpy_P(char *s1, str_P s2)
int indexOf(char ch) const
char * m_buffer
the actual char array
unsigned int m_length
the String length (not counting the '\0')
unsigned char operator>(const String &rhs) const
unsigned char concat(const String &str)
void replace(char find, char replace)
friend __StringSumHelper & operator+(const __StringSumHelper &lhs, const String &rhs)
unsigned char startsWith(const String &prefix) const