anilgkts / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Add a Stream::find(char) method #847

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What change would like to see?
find(char) doesn't exist, which means you need to wrap a single character as a 
string.

Why?
The current situation is completely fine with literals - e.g find("$") instead 
of find('$') - but it can get unnecessarily complex with variables.

For instance you can't write:
char target;
...
find(target);

Instead you need to do something along the lines of:
char target;
...
char buf[2];
buf[0] = target;
buf[1] = 0x00;
find(buf);

Original issue reported on code.google.com by pierre.b...@gmail.com on 6 Mar 2012 at 4:59