Fix crash on startup if an LV2 plugin has a bad .ttl file.
[ardour.git] / libs / glibmm2 / gio / giomm / fileinputstream.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3
4 #include <giomm/fileinputstream.h>
5 #include <giomm/private/fileinputstream_p.h>
6
7 // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
8
9 /* Copyright (C) 2007 The gtkmm Development Team
10  *
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.
15  *
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.
20  *
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.
24  */
25
26 #include <gio/gio.h>
27 #include "slot_async.h"
28 #include <glibmm/exceptionhandler.h>
29
30 namespace Gio
31 {
32
33 #ifdef GLIBMM_EXCEPTIONS_ENABLED
34 Glib::RefPtr<FileInfo> FileInputStream::query_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes)
35 #else
36 Glib::RefPtr<FileInfo> FileInputStream::query_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, std::auto_ptr<Glib::Error>& error)
37 #endif //GLIBMM_EXCEPTIONS_ENABLED
38 {
39   GError* gerror = 0;
40   Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
41 #ifdef GLIBMM_EXCEPTIONS_ENABLED
42   if(gerror)
43     ::Glib::Error::throw_exception(gerror);
44 #else
45   if(gerror)
46     error = ::Glib::Error::throw_exception(gerror);
47 #endif //GLIBMM_EXCEPTIONS_ENABLED
48
49   return retvalue;
50 }
51
52 #ifdef GLIBMM_EXCEPTIONS_ENABLED
53 Glib::RefPtr<FileInfo> FileInputStream::query_info(const std::string& attributes)
54 #else
55 Glib::RefPtr<FileInfo> FileInputStream::query_info(const std::string& attributes, std::auto_ptr<Glib::Error>& error)
56 #endif //GLIBMM_EXCEPTIONS_ENABLED
57 {
58   GError* gerror = 0;
59   Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), NULL, &(gerror)));
60 #ifdef GLIBMM_EXCEPTIONS_ENABLED
61   if(gerror)
62     ::Glib::Error::throw_exception(gerror);
63 #else
64   if(gerror)
65     error = ::Glib::Error::throw_exception(gerror);
66 #endif //GLIBMM_EXCEPTIONS_ENABLED
67
68   return retvalue;
69 }
70
71 void
72 FileInputStream::query_info_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, int io_priority)
73 {
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);
78
79   g_file_input_stream_query_info_async(gobj(),
80                                        const_cast<char*>(attributes.c_str()),
81                                        io_priority,
82                                        cancellable->gobj(),
83                                        &SignalProxy_async_callback,
84                                        slot_copy);
85 }
86
87 void
88 FileInputStream::query_info_async(const SlotAsyncReady& slot, const std::string& attributes, int io_priority)
89 {
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);
94
95   g_file_input_stream_query_info_async(gobj(),
96                                        const_cast<char*>(attributes.c_str()),
97                                        io_priority,
98                                        NULL,
99                                        &SignalProxy_async_callback,
100                                        slot_copy);
101 }
102
103 } // namespace Gio
104
105 namespace
106 {
107 } // anonymous namespace
108
109
110 namespace Glib
111 {
112
113 Glib::RefPtr<Gio::FileInputStream> wrap(GFileInputStream* object, bool take_copy)
114 {
115   return Glib::RefPtr<Gio::FileInputStream>( dynamic_cast<Gio::FileInputStream*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
116   //We use dynamic_cast<> in case of multiple inheritance.
117 }
118
119 } /* namespace Glib */
120
121
122 namespace Gio
123 {
124
125
126 /* The *_Class implementation: */
127
128 const Glib::Class& FileInputStream_Class::init()
129 {
130   if(!gtype_) // create the GType if necessary
131   {
132     // Glib::Class has to know the class init function to clone custom types.
133     class_init_func_ = &FileInputStream_Class::class_init_function;
134
135     // This is actually just optimized away, apparently with no harm.
136     // Make sure that the parent type has been created.
137     //CppClassParent::CppObjectType::get_type();
138
139     // Create the wrapper type, with the same class/instance size as the base type.
140     register_derived_type(g_file_input_stream_get_type());
141
142     // Add derived versions of interfaces, if the C type implements any interfaces:
143   Seekable::add_interface(get_type());
144
145   }
146
147   return *this;
148 }
149
150 void FileInputStream_Class::class_init_function(void* g_class, void* class_data)
151 {
152   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
153   CppClassParent::class_init_function(klass, class_data);
154
155 #ifdef GLIBMM_VFUNCS_ENABLED
156 #endif //GLIBMM_VFUNCS_ENABLED
157
158 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
159 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
160 }
161
162 #ifdef GLIBMM_VFUNCS_ENABLED
163 #endif //GLIBMM_VFUNCS_ENABLED
164
165 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
166 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
167
168
169 Glib::ObjectBase* FileInputStream_Class::wrap_new(GObject* object)
170 {
171   return new FileInputStream((GFileInputStream*)object);
172 }
173
174
175 /* The implementation: */
176
177 GFileInputStream* FileInputStream::gobj_copy()
178 {
179   reference();
180   return gobj();
181 }
182
183 FileInputStream::FileInputStream(const Glib::ConstructParams& construct_params)
184 :
185   Gio::InputStream(construct_params)
186 {
187
188 }
189
190 FileInputStream::FileInputStream(GFileInputStream* castitem)
191 :
192   Gio::InputStream((GInputStream*)(castitem))
193 {}
194
195
196 FileInputStream::~FileInputStream()
197 {}
198
199
200 FileInputStream::CppClassType FileInputStream::fileinputstream_class_; // initialize static member
201
202 GType FileInputStream::get_type()
203 {
204   return fileinputstream_class_.init().get_type();
205 }
206
207 GType FileInputStream::get_base_type()
208 {
209   return g_file_input_stream_get_type();
210 }
211
212
213 #ifdef GLIBMM_EXCEPTIONS_ENABLED
214 Glib::RefPtr<FileInfo> FileInputStream::query_info_finish(const Glib::RefPtr<AsyncResult>& result)
215 #else
216 Glib::RefPtr<FileInfo> FileInputStream::query_info_finish(const Glib::RefPtr<AsyncResult>& result, std::auto_ptr<Glib::Error>& error)
217 #endif //GLIBMM_EXCEPTIONS_ENABLED
218 {
219   GError* gerror = 0;
220   Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_input_stream_query_info_finish(gobj(), Glib::unwrap(result), &(gerror)));
221 #ifdef GLIBMM_EXCEPTIONS_ENABLED
222   if(gerror)
223     ::Glib::Error::throw_exception(gerror);
224 #else
225   if(gerror)
226     error = ::Glib::Error::throw_exception(gerror);
227 #endif //GLIBMM_EXCEPTIONS_ENABLED
228
229   return retvalue;
230
231 }
232
233
234 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
235 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
236
237 #ifdef GLIBMM_VFUNCS_ENABLED
238 #endif //GLIBMM_VFUNCS_ENABLED
239
240
241 } // namespace Gio
242
243