mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-02 02:40:07 +02:00
parent
322ac7ff68
commit
b196cd7447
@ -823,6 +823,7 @@ g_memory_output_stream_new
|
|||||||
g_memory_output_stream_get_data
|
g_memory_output_stream_get_data
|
||||||
g_memory_output_stream_get_size
|
g_memory_output_stream_get_size
|
||||||
g_memory_output_stream_get_data_size
|
g_memory_output_stream_get_data_size
|
||||||
|
g_memory_output_stream_steal_data
|
||||||
<SUBSECTION Standard>
|
<SUBSECTION Standard>
|
||||||
GMemoryOutputStreamClass
|
GMemoryOutputStreamClass
|
||||||
G_MEMORY_OUTPUT_STREAM
|
G_MEMORY_OUTPUT_STREAM
|
||||||
|
@ -707,6 +707,7 @@ g_memory_output_stream_new
|
|||||||
g_memory_output_stream_get_data
|
g_memory_output_stream_get_data
|
||||||
g_memory_output_stream_get_data_size
|
g_memory_output_stream_get_data_size
|
||||||
g_memory_output_stream_get_size
|
g_memory_output_stream_get_size
|
||||||
|
g_memory_output_stream_steal_data
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -440,6 +440,35 @@ g_memory_output_stream_get_data_size (GMemoryOutputStream *ostream)
|
|||||||
return ostream->priv->valid_len;
|
return ostream->priv->valid_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* g_memory_output_stream_steal_data:
|
||||||
|
* @ostream: a #GMemoryOutputStream
|
||||||
|
*
|
||||||
|
* Gets any loaded data from the @ostream. Ownership of the data
|
||||||
|
* is transferred to the caller; when no longer needed it must be
|
||||||
|
* freed using the free function set in @ostream's
|
||||||
|
* #GMemoryOutputStream:destroy-function property.
|
||||||
|
*
|
||||||
|
* @ostream must be closed before calling this function.
|
||||||
|
*
|
||||||
|
* Returns: (transfer full): the stream's data
|
||||||
|
*
|
||||||
|
* Since: 2.26
|
||||||
|
**/
|
||||||
|
gpointer
|
||||||
|
g_memory_output_stream_steal_data (GMemoryOutputStream *ostream)
|
||||||
|
{
|
||||||
|
gpointer data;
|
||||||
|
|
||||||
|
g_return_val_if_fail (G_IS_MEMORY_OUTPUT_STREAM (ostream), NULL);
|
||||||
|
g_return_val_if_fail (g_output_stream_is_closed (G_OUTPUT_STREAM (ostream)), NULL);
|
||||||
|
|
||||||
|
data = ostream->priv->data;
|
||||||
|
ostream->priv->data = NULL;
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
array_resize (GMemoryOutputStream *ostream,
|
array_resize (GMemoryOutputStream *ostream,
|
||||||
gsize size,
|
gsize size,
|
||||||
|
@ -91,6 +91,7 @@ GOutputStream *g_memory_output_stream_new (gpointer data,
|
|||||||
gpointer g_memory_output_stream_get_data (GMemoryOutputStream *ostream);
|
gpointer g_memory_output_stream_get_data (GMemoryOutputStream *ostream);
|
||||||
gsize g_memory_output_stream_get_size (GMemoryOutputStream *ostream);
|
gsize g_memory_output_stream_get_size (GMemoryOutputStream *ostream);
|
||||||
gsize g_memory_output_stream_get_data_size (GMemoryOutputStream *ostream);
|
gsize g_memory_output_stream_get_data_size (GMemoryOutputStream *ostream);
|
||||||
|
gpointer g_memory_output_stream_steal_data (GMemoryOutputStream *ostream);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user