This new method will return a GBytes instance containing the
contents of the SoupBuffer.
https://bugzilla.gnome.org/show_bug.cgi?id=676776
soup_buffer_get_data
soup_buffer_copy
soup_buffer_free
+soup_buffer_get_as_bytes
<SUBSECTION>
SoupMessageBody
soup_message_body_new
}
}
+/**
+ * soup_buffer_get_as_bytes:
+ * @buffer: a #SoupBuffer
+ *
+ * Returns: (transfer full): a new #GBytes which has the same content
+ * as the #SoupBuffer.
+ *
+ * Since: 2.40
+ */
+GBytes *
+soup_buffer_get_as_bytes (SoupBuffer *buffer)
+{
+ SoupBuffer *copy;
+
+ copy = soup_buffer_copy (buffer);
+ return g_bytes_new_with_free_func (copy->data, copy->length, soup_buffer_free, copy);
+}
+
GType
soup_buffer_get_type (void)
{
gsize *length);
SoupBuffer *soup_buffer_copy (SoupBuffer *buffer);
void soup_buffer_free (SoupBuffer *buffer);
+GBytes *soup_buffer_get_as_bytes (SoupBuffer *buffer);
typedef struct {
const char *data;