1 // Generated by gtkmmproc -- DO NOT MODIFY!
4 #include <giomm/bufferedinputstream.h>
5 #include <giomm/private/bufferedinputstream_p.h>
7 // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
9 /* Copyright (C) 2008 The gtkmm Development Team
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
21 * You should have received a copy of the GNU Library General Public
22 * License along with this library; if not, write to the Free
23 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 #include "slot_async.h"
31 Glib::RefPtr<BufferedInputStream> BufferedInputStream::create_sized(const Glib::RefPtr<InputStream>& base_stream, gsize size)
33 return Glib::RefPtr<Gio::BufferedInputStream>(new BufferedInputStream(base_stream, size));
36 #ifdef GLIBMM_EXCEPTIONS_ENABLED
37 gssize BufferedInputStream::fill(gssize count)
39 gssize BufferedInputStream::fill(gssize count, std::auto_ptr<Glib::Error>& error)
40 #endif //GLIBMM_EXCEPTIONS_ENABLED
43 gssize retvalue = g_buffered_input_stream_fill(const_cast<GBufferedInputStream*>(gobj()), count, NULL, &(gerror));
44 #ifdef GLIBMM_EXCEPTIONS_ENABLED
46 ::Glib::Error::throw_exception(gerror);
49 error = ::Glib::Error::throw_exception(gerror);
50 #endif //GLIBMM_EXCEPTIONS_ENABLED
55 void BufferedInputStream::fill_async(const SlotAsyncReady& slot,
57 const Glib::RefPtr<Cancellable>& cancellable,
60 // Create a copy of the slot.
61 // A pointer to it will be passed through the callback's data parameter
62 // and deleted in the callback.
63 SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
65 g_buffered_input_stream_fill_async(gobj(),
69 &SignalProxy_async_callback,
73 void BufferedInputStream::fill_async(const SlotAsyncReady& slot,
77 // Create a copy of the slot.
78 // A pointer to it will be passed through the callback's data parameter
79 // and deleted in the callback.
80 SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
82 g_buffered_input_stream_fill_async(gobj(),
86 &SignalProxy_async_callback,
90 #ifdef GLIBMM_EXCEPTIONS_ENABLED
91 int BufferedInputStream::read_byte()
93 int BufferedInputStream::read_byte(std::auto_ptr<Glib::Error>& error)
94 #endif //GLIBMM_EXCEPTIONS_ENABLED
97 int retvalue = g_buffered_input_stream_read_byte(gobj(), NULL, &(gerror));
98 #ifdef GLIBMM_EXCEPTIONS_ENABLED
100 ::Glib::Error::throw_exception(gerror);
103 error = ::Glib::Error::throw_exception(gerror);
104 #endif //GLIBMM_EXCEPTIONS_ENABLED
115 } // anonymous namespace
121 Glib::RefPtr<Gio::BufferedInputStream> wrap(GBufferedInputStream* object, bool take_copy)
123 return Glib::RefPtr<Gio::BufferedInputStream>( dynamic_cast<Gio::BufferedInputStream*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
124 //We use dynamic_cast<> in case of multiple inheritance.
127 } /* namespace Glib */
134 /* The *_Class implementation: */
136 const Glib::Class& BufferedInputStream_Class::init()
138 if(!gtype_) // create the GType if necessary
140 // Glib::Class has to know the class init function to clone custom types.
141 class_init_func_ = &BufferedInputStream_Class::class_init_function;
143 // This is actually just optimized away, apparently with no harm.
144 // Make sure that the parent type has been created.
145 //CppClassParent::CppObjectType::get_type();
147 // Create the wrapper type, with the same class/instance size as the base type.
148 register_derived_type(g_buffered_input_stream_get_type());
150 // Add derived versions of interfaces, if the C type implements any interfaces:
157 void BufferedInputStream_Class::class_init_function(void* g_class, void* class_data)
159 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
160 CppClassParent::class_init_function(klass, class_data);
162 #ifdef GLIBMM_VFUNCS_ENABLED
163 #endif //GLIBMM_VFUNCS_ENABLED
165 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
166 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
169 #ifdef GLIBMM_VFUNCS_ENABLED
170 #endif //GLIBMM_VFUNCS_ENABLED
172 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
173 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
176 Glib::ObjectBase* BufferedInputStream_Class::wrap_new(GObject* object)
178 return new BufferedInputStream((GBufferedInputStream*)object);
182 /* The implementation: */
184 GBufferedInputStream* BufferedInputStream::gobj_copy()
190 BufferedInputStream::BufferedInputStream(const Glib::ConstructParams& construct_params)
192 Gio::FilterInputStream(construct_params)
197 BufferedInputStream::BufferedInputStream(GBufferedInputStream* castitem)
199 Gio::FilterInputStream((GFilterInputStream*)(castitem))
203 BufferedInputStream::~BufferedInputStream()
207 BufferedInputStream::CppClassType BufferedInputStream::bufferedinputstream_class_; // initialize static member
209 GType BufferedInputStream::get_type()
211 return bufferedinputstream_class_.init().get_type();
214 GType BufferedInputStream::get_base_type()
216 return g_buffered_input_stream_get_type();
220 BufferedInputStream::BufferedInputStream(const Glib::RefPtr<InputStream>& base_stream)
222 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
224 Gio::FilterInputStream(Glib::ConstructParams(bufferedinputstream_class_.init(), "base_stream", const_cast<GInputStream*>(Glib::unwrap(base_stream)), static_cast<char*>(0)))
230 BufferedInputStream::BufferedInputStream(const Glib::RefPtr<InputStream>& base_stream, gsize size)
232 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
234 Gio::FilterInputStream(Glib::ConstructParams(bufferedinputstream_class_.init(), "base_stream", const_cast<GInputStream*>(Glib::unwrap(base_stream)), "size", size, static_cast<char*>(0)))
240 Glib::RefPtr<BufferedInputStream> BufferedInputStream::create(const Glib::RefPtr<InputStream>& base_stream)
242 return Glib::RefPtr<BufferedInputStream>( new BufferedInputStream(base_stream) );
244 gsize BufferedInputStream::get_buffer_size() const
246 return g_buffered_input_stream_get_buffer_size(const_cast<GBufferedInputStream*>(gobj()));
249 void BufferedInputStream::set_buffer_size(gsize size)
251 g_buffered_input_stream_set_buffer_size(gobj(), size);
254 gsize BufferedInputStream::get_available() const
256 return g_buffered_input_stream_get_available(const_cast<GBufferedInputStream*>(gobj()));
259 gsize BufferedInputStream::peek(void* buffer, gsize offset, gsize count) const
261 return g_buffered_input_stream_peek(const_cast<GBufferedInputStream*>(gobj()), buffer, offset, count);
264 const void* BufferedInputStream::peek_buffer(gsize& count) const
266 return g_buffered_input_stream_peek_buffer(const_cast<GBufferedInputStream*>(gobj()), &(count));
269 #ifdef GLIBMM_EXCEPTIONS_ENABLED
270 gssize BufferedInputStream::fill(gssize count, const Glib::RefPtr<Cancellable>& cancellable)
272 gssize BufferedInputStream::fill(gssize count, const Glib::RefPtr<Cancellable>& cancellable, std::auto_ptr<Glib::Error>& error)
273 #endif //GLIBMM_EXCEPTIONS_ENABLED
276 gssize retvalue = g_buffered_input_stream_fill(gobj(), count, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror));
277 #ifdef GLIBMM_EXCEPTIONS_ENABLED
279 ::Glib::Error::throw_exception(gerror);
282 error = ::Glib::Error::throw_exception(gerror);
283 #endif //GLIBMM_EXCEPTIONS_ENABLED
289 #ifdef GLIBMM_EXCEPTIONS_ENABLED
290 gssize BufferedInputStream::fill_finish(const Glib::RefPtr<AsyncResult>& result)
292 gssize BufferedInputStream::fill_finish(const Glib::RefPtr<AsyncResult>& result, std::auto_ptr<Glib::Error>& error)
293 #endif //GLIBMM_EXCEPTIONS_ENABLED
296 gssize retvalue = g_buffered_input_stream_fill_finish(gobj(), Glib::unwrap(result), &(gerror));
297 #ifdef GLIBMM_EXCEPTIONS_ENABLED
299 ::Glib::Error::throw_exception(gerror);
302 error = ::Glib::Error::throw_exception(gerror);
303 #endif //GLIBMM_EXCEPTIONS_ENABLED
309 #ifdef GLIBMM_EXCEPTIONS_ENABLED
310 int BufferedInputStream::read_byte(const Glib::RefPtr<Cancellable>& cancellable)
312 int BufferedInputStream::read_byte(const Glib::RefPtr<Cancellable>& cancellable, std::auto_ptr<Glib::Error>& error)
313 #endif //GLIBMM_EXCEPTIONS_ENABLED
316 int retvalue = g_buffered_input_stream_read_byte(gobj(), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror));
317 #ifdef GLIBMM_EXCEPTIONS_ENABLED
319 ::Glib::Error::throw_exception(gerror);
322 error = ::Glib::Error::throw_exception(gerror);
323 #endif //GLIBMM_EXCEPTIONS_ENABLED
330 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
331 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
333 #ifdef GLIBMM_VFUNCS_ENABLED
334 #endif //GLIBMM_VFUNCS_ENABLED