Skip to content

Commit 1000186

Browse files
committed
Protecting the version of parseInt() and parseFloat(). (Paul Stoffregen)
This should allow us more flexibility in determining how to handle these functions later. For example, in specifying that initial characters shouldn't be skipped. http://code.google.com/p/arduino/issues/detail?id=698
1 parent 726acf7 commit 1000186

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

hardware/arduino/cores/arduino/Stream.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,8 @@ class Stream : public Print
7171
// initial characters that are not digits (or the minus sign) are skipped
7272
// integer is terminated by the first character that is not a digit.
7373

74-
long parseInt(char skipChar); // as above but the given skipChar is ignored
75-
// as above but the given skipChar is ignored
76-
// this allows format characters (typically commas) in values to be ignored
77-
7874
float parseFloat(); // float version of parseInt
7975

80-
float parseFloat(char skipChar); // as above but the given skipChar is ignored
81-
8276
int readBytes( char *buffer, size_t length); // read chars from stream into buffer
8377
// terminates if length characters have been read or timeout (see setTimeout)
8478
// returns the number of characters placed in the buffer (0 means no valid data found)
@@ -89,6 +83,12 @@ class Stream : public Print
8983

9084
// Arduino String functions to be added here
9185

86+
protected:
87+
long parseInt(char skipChar); // as above but the given skipChar is ignored
88+
// as above but the given skipChar is ignored
89+
// this allows format characters (typically commas) in values to be ignored
90+
91+
float parseFloat(char skipChar); // as above but the given skipChar is ignored
9292
};
9393

9494
#endif

0 commit comments

Comments
 (0)