David A. Mellis
1cac0f3eb7
Restoring concatenation of built-in types with String.
2011-03-31 10:56:14 -04:00
David A. Mellis
ffe7bc53c1
Adding F("foo") syntax for flash strings.
2011-03-27 15:06:20 -04:00
David A. Mellis
99e642a26d
String: removing implicit numeric conversions and new approach to "if (s)".
...
This makes explicit the String constructors that take numeric types and chars and removes the versions of concat() and operator=() and operator+() that accept numberic types.
It also replaces the operator bool() with a operator that converts to a function pointer. This allows for uses like "if (s)" but not "s + 123". See: http://www.artima.com/cppsource/safebool.html . This allowed removing the disambiguating operator+() functions and relying solely on StringSumHelper and anonymous temporaries once again.
Also, now treating unsigned char's like int when constructing Strings from them, i.e. String(byte(65)) is now "65" not "A". This is consistent with the new behavior of Serial.print(byte).
2011-03-26 18:52:54 -04:00
David A. Mellis
cedea72273
Commenting String API behavior.
2011-03-23 22:42:05 -04:00
David A. Mellis
58d04ab3a3
Return an invalid string (not a partial one) when operator+() fails.
2011-03-19 11:14:17 -04:00
David A. Mellis
7dea0522f4
Starting to distinguish between empty strings and invalid (null) ones.
2011-03-18 21:45:27 -04:00
David A. Mellis
45884b1231
Protecting String copy() and move().
2011-03-13 19:39:04 -04:00
David A. Mellis
a5f6e65242
Adding additional String + operators for disambiguation.
...
The operator bool() means that you could implicitly convert a String to a bool and then add it to it an int, for example. Which means our operator+ has to match exactly or it will be ambiguous.
2011-03-13 19:31:10 -04:00
David A. Mellis
76776e7a46
Moving move() to __GXX_EXPERIMENTAL_CXX0X__ only, adding operator bool().
2011-03-13 16:46:06 -04:00
David A. Mellis
98b403114c
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.
2011-03-12 14:03:34 -05:00
David A. Mellis
b4b32f60f1
Don't return the string when modifying its value.
...
Changing toLowerCase(), toUpperCase(), trim() and replace() to return void instead of a reference to the string that's just been changed. That way, it's clear that the functions modify the string they've been called on.
2011-03-11 18:54:58 -05:00
David A. Mellis
99e0c131fc
Renaming append() back to concat().
2011-03-11 18:04:31 -05:00
David A. Mellis
22786eaed2
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.
2011-03-11 18:01:40 -05:00
David A. Mellis
438bca3cb2
Rewrite of the String class by Paul Stoffregen.
...
http://www.pjrc.com/teensy/string_class_experimental.html
2011-03-11 17:56:10 -05:00
David A. Mellis
e009c5c6c6
Renamed WProgram.h to Arduino.h.
2011-03-01 19:52:13 -05:00
David A. Mellis
4a90c4bd40
Redoing 448222e4b65e0cf44dfc0c494f7f76901f1fabea without all the extra files.
...
Adds toInt() to String, WCharacter.h (from Wiring), and an SD Datalogger example.
2010-11-29 15:20:30 -05:00
David A. Mellis
80c5173bfd
Revert "added toInt() function to WString".
...
This reverts commit 448222e4b65e0cf44dfc0c494f7f76901f1fabea.
2010-11-29 15:14:10 -05:00
Tom Igoe
15f51fc1f8
added toInt() function to WString
2010-11-29 11:31:00 -05:00
David A. Mellis
4bbd4f7448
Changing String::toCharArray() and getBytes() to accept a buffer, rather than return one. That way they don't expose the internal representation of the String class, allowing future optimization. Thanks to Paul Stoffregen.
2010-08-28 10:23:54 +00:00
David A. Mellis
14831247bc
Adding some basic error checking to the String class (i.e. checking for a non-null buffer before modifying its contents).
2010-08-18 21:39:28 +00:00
David A. Mellis
fddeda1717
No longer requiring WProgram.h for Print / Stream classes (replaced Arduino-specific type names in String).
2010-08-06 01:23:19 +00:00
Tom Igoe
58f043e0f3
added more String examples
2010-07-27 22:59:18 +00:00
David A. Mellis
e871ae5236
Reverting changes to String class and modifying to allow + and += to work on more types.
2010-07-27 14:20:56 +00:00
Tom Igoe
8eea4576c4
removed append() from String library
2010-07-27 10:18:04 +00:00
Tom Igoe
58f5b67b71
checked in Xiaoyang Feng's changes to String library
2010-07-27 10:09:09 +00:00
Tom Igoe
82fefa76ac
Checked in Xiaoyang's changes to String library
2010-07-27 10:06:49 +00:00
David A. Mellis
2c32369685
Adding support for printing Strings to the Print class.
2010-07-04 23:22:34 +00:00
David A. Mellis
50bfce889e
Modifying String from new/delete to malloc()/free(). Also #include'ing WString.h from WProgram.h.
2010-07-04 16:36:52 +00:00
David A. Mellis
0c09741c72
Adding WString.h and WString.cpp straight from Wiring (r. 726). Won't actually work yet.
2010-07-04 16:27:23 +00:00