Add g_data_input_stream_read_upto{,async,finish}

These functions are meant to replace the read_until() flavour, with the
following improvements:

  - consistency between the synchronous and asynchronous versions as to
    if the separator character is read (it never is).

  - support for using a nul byte as a separator character by way of
    addition of a length parameter which allows stop_chars to be treated
    as a byte array rather than a nul-terminated string.

The read_until() functions are not yet formally deprecated, but a note
has been added to the documentation warning not to use them as they will
be in the future.

This is bug #584284.
This commit is contained in:
Ryan Lortie
2010-03-23 01:12:01 -05:00
parent 0ecfc6e1f9
commit 2e78d07f86
5 changed files with 312 additions and 78 deletions

View File

@@ -671,6 +671,9 @@ g_data_input_stream_read_uint64
g_data_input_stream_read_line
g_data_input_stream_read_line_async
g_data_input_stream_read_line_finish
g_data_input_stream_read_upto
g_data_input_stream_read_upto_async
g_data_input_stream_read_upto_finish
g_data_input_stream_read_until
g_data_input_stream_read_until_async
g_data_input_stream_read_until_finish