read_upto
Description:
public string read_upto (string stop_chars, ssize_t stop_chars_len, out size_t length, Cancellable? cancellable = null) throws IOError
Reads a string from the data input stream, up to the first occurrence of any of the stop characters.
In contrast to read_until, this function does not consume the stop character. You have to use read_byte to get it before calling read_upto again.
Note that stop_chars
may contain '\0' if stop_chars_len
is specified.
The returned string will always be nul-terminated on success.
Parameters:
this | |
stop_chars |
characters to terminate the read |
stop_chars_len |
length of |
length |
a size_t to get the length of the data read in |
cancellable |
optional Cancellable object, null to ignore |
Returns:
a string with the data that was read before encountering any of the stop characters. Set |