[libzapojit] skydrive: Implement download_file_to_stream_async



commit 09ed0025275b6d454468fa0eeefdc8b8befc46d2
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Jun 1 21:13:52 2012 +0200

    skydrive: Implement download_file_to_stream_async

 src/zpj-skydrive.c |   26 ++++++++++++++++++++++++++
 src/zpj-skydrive.h |   10 ++++++++++
 2 files changed, 36 insertions(+), 0 deletions(-)
---
diff --git a/src/zpj-skydrive.c b/src/zpj-skydrive.c
index 476b967..8590348 100644
--- a/src/zpj-skydrive.c
+++ b/src/zpj-skydrive.c
@@ -615,6 +615,32 @@ zpj_skydrive_download_file_to_stream (ZpjSkydrive *self,
 }
 
 
+void
+zpj_skydrive_download_file_to_stream_async (ZpjSkydrive *self,
+                                            ZpjSkydriveFile *file,
+                                            GCancellable *cancellable,
+                                            GAsyncReadyCallback callback,
+                                            gpointer user_data)
+{
+  const gchar *file_id;
+
+  g_return_if_fail (ZPJ_IS_SKYDRIVE (self));
+  g_return_if_fail (ZPJ_IS_SKYDRIVE_FILE (file));
+
+  file_id = zpj_skydrive_entry_get_id (ZPJ_SKYDRIVE_ENTRY (file));
+  g_return_if_fail (file_id != NULL && file_id[0] != '\0');
+
+  zpj_skydrive_download_file_id_to_stream_async (self, file_id, cancellable, callback, user_data);
+}
+
+
+GInputStream *
+zpj_skydrive_download_file_to_stream_finish (ZpjSkydrive *self, GAsyncResult *res, GError **error)
+{
+  return zpj_skydrive_download_file_id_to_stream_finish (self, res, error);
+}
+
+
 /**
  * zpj_skydrive_download_file_id_to_path:
  * @self: A #ZpjSkydrive.
diff --git a/src/zpj-skydrive.h b/src/zpj-skydrive.h
index 961098f..54d66dd 100644
--- a/src/zpj-skydrive.h
+++ b/src/zpj-skydrive.h
@@ -121,6 +121,16 @@ GInputStream       *zpj_skydrive_download_file_to_stream     (ZpjSkydrive *self,
                                                               GCancellable *cancellable,
                                                               GError **error);
 
+void                zpj_skydrive_download_file_to_stream_async     (ZpjSkydrive *self,
+                                                                    ZpjSkydriveFile *file,
+                                                                    GCancellable *cancellable,
+                                                                    GAsyncReadyCallback callback,
+                                                                    gpointer user_data);
+
+GInputStream       *zpj_skydrive_download_file_to_stream_finish    (ZpjSkydrive *self,
+                                                                    GAsyncResult *res,
+                                                                    GError **error);
+
 gboolean            zpj_skydrive_download_file_id_to_path    (ZpjSkydrive *self,
                                                               const gchar *file_id,
                                                               const gchar *path,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]