diff options
author | Murray Cumming <murrayc@murrayc.com> | 2015-03-03 09:56:19 +0100 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2015-03-03 09:56:19 +0100 |
commit | fdc374adad2d72fb693eed508170a6e2e06fa8a8 (patch) | |
tree | 2e760a50fb1d084b4ad5bb92cc9db80bfcb20aad /gio/src/outputstream.ccg | |
parent | 7d319058dc84c340bb06b9ef59c28f2725d0102b (diff) | |
download | glibmm-fdc374adad2d72fb693eed508170a6e2e06fa8a8.tar.gz |
Gio::OutputStream: Add write_all_async() and write_all_finish().
Diffstat (limited to 'gio/src/outputstream.ccg')
-rw-r--r-- | gio/src/outputstream.ccg | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gio/src/outputstream.ccg b/gio/src/outputstream.ccg index d991bf7f..0ed1e138 100644 --- a/gio/src/outputstream.ccg +++ b/gio/src/outputstream.ccg @@ -58,6 +58,43 @@ OutputStream::write_async(const void* buffer, gsize count, const SlotAsyncReady& slot_copy); } + + +void +OutputStream::write_all_async(const void* buffer, gsize count, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +{ + // Create a copy of the slot. + // A pointer to it will be passed through the callback's data parameter + // and deleted in the callback. + SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + + g_output_stream_write_all_async(gobj(), + buffer, + count, + io_priority, + Glib::unwrap(cancellable), + &SignalProxy_async_callback, + slot_copy); +} + +void +OutputStream::write_all_async(const void* buffer, gsize count, const SlotAsyncReady& slot, int io_priority) +{ + // Create a copy of the slot. + // A pointer to it will be passed through the callback's data parameter + // and deleted in the callback. + SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + + g_output_stream_write_all_async(gobj(), + buffer, + count, + io_priority, + 0, + &SignalProxy_async_callback, + slot_copy); +} + + void OutputStream::splice_async(const Glib::RefPtr<InputStream>& source, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, OutputStreamSpliceFlags flags, int io_priority) { |