summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorentin Noël <corentin.noel@collabora.com>2019-04-27 15:40:43 +0200
committerCorentin Noël <corentin.noel@collabora.com>2019-04-30 00:18:48 +0200
commit0ac857cc859eaf5ca27c78da07f2ade048f64cdb (patch)
treef0d4ece05ddcd66c0241cd2cceaa9c40b816a049
parente83913542278d4f9f1075f559300d1c3e4aaab38 (diff)
downloadlibical-git-0ac857cc859eaf5ca27c78da07f2ade048f64cdb.tar.gz
[libical-glib] Allow to create ICalAttach from GBytes
-rw-r--r--src/libical-glib/api/i-cal-attach.xml18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libical-glib/api/i-cal-attach.xml b/src/libical-glib/api/i-cal-attach.xml
index 3bf0bff3..c0c1e108 100644
--- a/src/libical-glib/api/i-cal-attach.xml
+++ b/src/libical-glib/api/i-cal-attach.xml
@@ -26,6 +26,24 @@
<returns type="ICalAttach *" annotation="transfer full" comment="The newly created #ICalAttach" />
<comment xml:space="preserve">Create a new #ICalAttach from the data.</comment>
</method>
+ <declaration position="body">
+static void unref_g_bytes(unsigned char *data, void *user_data)
+{
+ GBytes *bytes = user_data;
+
+ g_return_if_fail (data != NULL);
+ g_return_if_fail (bytes != NULL);
+
+ g_bytes_unref (bytes);
+}</declaration>
+ <method name="i_cal_attach_new_from_bytes" corresponds="CUSTOM" kind="constructor" since="1.0">
+ <parameter type="GBytes *" annotation="transfer full" name="bytes" comment="The #GBytes holding the data used to create the #ICalAttach"/>
+ <returns type="ICalAttach *" annotation="transfer full" comment="The newly created #ICalAttach" />
+ <comment xml:space="preserve">Create a new #ICalAttach from the data in bytes. Takes a reference of @bytes, increase the reference before calling this function if you with to use it afterward.</comment>
+ <custom> g_return_val_if_fail (bytes != NULL, NULL);
+
+ return i_cal_attach_new_full (icalattach_new_from_data (g_bytes_get_data (bytes, NULL), unref_g_bytes, bytes), NULL);</custom>
+ </method>
<method name="i_cal_attach_ref" corresponds="icalattach_ref" annotation="skip" kind="others" since="1.0">
<parameter type="ICalAttach *" name="attach" comment="The #ICalAttach to be referenced by once"/>
<comment xml:space="preserve">Increase the ref counter by 1 for the @attach</comment>