Stream class

findUntil()

findUntil() reads data from the stream until the target string or terminator string is found.

// PROTOTYPES
bool findUntil(char *target, char *terminator);
bool findUntil(char *target, size_t targetLen, char *terminate, size_t termLen);

// SYNTAX
stream.findUntil(target, terminal);        // reads data from the stream until the target string or terminator is found
stream.findUntil(target, terminal, length);    // reads data from the stream until the target string of given length or terminator is found

Parameters:

  • stream : an instance of a class that inherits from Stream
  • target : pointer to the string to search (char *)
  • terminal : pointer to the terminal string to search for (char *)
  • length : length of target string to search for (size_t)

Returns: returns true if target string or terminator string is found, false if timed out