1 // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 /* Copyright (C) 2007 The gtkmm Development Team
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include <glibmm/error.h>
23 #include <glibmm/exceptionhandler.h>
24 #include "slot_async.h"
29 #ifdef GLIBMM_EXCEPTIONS_ENABLED
30 Glib::RefPtr<FileInfo> FileOutputStream::query_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes)
32 Glib::RefPtr<FileInfo> FileOutputStream::query_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, std::auto_ptr<Glib::Error>& error)
33 #endif //GLIBMM_EXCEPTIONS_ENABLED
36 Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
37 #ifdef GLIBMM_EXCEPTIONS_ENABLED
39 ::Glib::Error::throw_exception(gerror);
42 error = ::Glib::Error::throw_exception(gerror);
43 #endif //GLIBMM_EXCEPTIONS_ENABLED
46 retvalue->reference(); //The function does not do a ref for us.
50 #ifdef GLIBMM_EXCEPTIONS_ENABLED
51 Glib::RefPtr<FileInfo> FileOutputStream::query_info(const std::string& attributes)
53 Glib::RefPtr<FileInfo> FileOutputStream::query_info(const std::string& attributes, std::auto_ptr<Glib::Error>& error)
54 #endif //GLIBMM_EXCEPTIONS_ENABLED
57 Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), NULL, &(gerror)));
58 #ifdef GLIBMM_EXCEPTIONS_ENABLED
60 ::Glib::Error::throw_exception(gerror);
63 error = ::Glib::Error::throw_exception(gerror);
64 #endif //GLIBMM_EXCEPTIONS_ENABLED
67 retvalue->reference(); //The function does not do a ref for us.
72 FileOutputStream::query_info_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, int io_priority)
74 // Create a copy of the slot.
75 // A pointer to it will be passed through the callback's data parameter
76 // and deleted in the callback.
77 SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
79 g_file_output_stream_query_info_async(gobj(),
80 const_cast<char*>(attributes.c_str()),
83 &SignalProxy_async_callback,
88 FileOutputStream::query_info_async(const SlotAsyncReady& slot, const std::string& attributes, int io_priority)
90 // Create a copy of the slot.
91 // A pointer to it will be passed through the callback's data parameter
92 // and deleted in the callback.
93 SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
95 g_file_output_stream_query_info_async(gobj(),
96 const_cast<char*>(attributes.c_str()),
99 &SignalProxy_async_callback,