/*
Stream.cpp - adds parsing methods to Stream class
Copyright (c) 2008 David A. Mellis. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Created July 2011
parsing functions based on TextFinder library by Michael Margolis
*/
// private method to read stream with timeout
int
// private method to peek stream with timeout
int
// returns peek of the next digit in the stream or -1 if timeout
// discards non-numeric characters
int
// Public Methods
//////////////////////////////////////////////////////////////
void
// find returns true if the target string is found
bool
// reads data from the stream until the target string of given length is found
// returns true if target string is found, false if timed out
bool
// as find but search ends if the terminator string is found
bool
// reads data from the stream until the target string of the given length is found
// search terminated if the terminator string is found
// returns true if target string is found, false if terminated or timed out
bool
// returns the first valid (long) integer value from the current position.
// initial characters that are not digits (or the minus sign) are skipped
// function is terminated by the first character that is not a digit.
long
// as above but a given skipChar is ignored
// this allows format characters (typically commas) in values to be ignored
long
// as parseInt but returns a floating point value
float
// as above but the given skipChar is ignored
// this allows format characters (typically commas) in values to be ignored
float
// read characters from stream into buffer
// terminates if length characters have been read, or timeout (see setTimeout)
// returns the number of characters placed in the buffer
// the buffer is NOT null terminated.
//
size_t
// as readBytes with terminator character
// terminates if length characters have been read, timeout, or if the terminator character detected
// returns the number of characters placed in the buffer (0 means no valid data found)
size_t
String
String