Fix crash on startup if an LV2 plugin has a bad .ttl file.
[ardour.git] / libs / glibmm2 / gio / giomm / fileinfo.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3
4 #include <giomm/fileinfo.h>
5 #include <giomm/private/fileinfo_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
28 namespace Gio {
29
30 // FileAttributeMatcher
31
32 Glib::RefPtr<FileAttributeMatcher>
33 FileAttributeMatcher::create(const std::string& attributes)
34 {
35   return Glib::wrap(g_file_attribute_matcher_new(attributes.c_str()));
36 }
37
38 Glib::TimeVal FileInfo::modification_time() const
39 {
40   Glib::TimeVal result;
41   g_file_info_get_modification_time(const_cast<GFileInfo*>(gobj()), (GTimeVal*)(&result));
42   return result;
43 }
44
45 } // namespace Gio
46
47 namespace
48 {
49 } // anonymous namespace
50
51
52 /* Why reinterpret_cast<FileAttributeMatcher*>(gobject) is needed:
53  *
54  * A FileAttributeMatcher instance is in fact always a GFileAttributeMatcher instance.
55  * Unfortunately, GFileAttributeMatcher cannot be a member of FileAttributeMatcher,
56  * because it is an opaque struct.  Also, the C interface does not provide
57  * any hooks to install a destroy notification handler, thus we cannot
58  * wrap it dynamically either.
59  *
60  * The cast works because FileAttributeMatcher does not have any member data, and
61  * it is impossible to derive from it.  This is ensured by not implementing
62  * the (protected) default constructor.  The ctor is protected rather than
63  * private just to avoid a compile warning.
64  */
65
66 namespace Glib
67 {
68
69 Glib::RefPtr<Gio::FileAttributeMatcher> wrap(GFileAttributeMatcher* object, bool take_copy)
70 {
71   if(take_copy && object)
72     g_file_attribute_matcher_ref(object);
73
74   // See the comment at the top of this file, if you want to know why the cast works.
75   return Glib::RefPtr<Gio::FileAttributeMatcher>(reinterpret_cast<Gio::FileAttributeMatcher*>(object));
76 }
77
78 } // namespace Glib
79
80
81 namespace Gio
82 {
83
84
85 void FileAttributeMatcher::reference() const
86 {
87   // See the comment at the top of this file, if you want to know why the cast works.
88   g_file_attribute_matcher_ref(reinterpret_cast<GFileAttributeMatcher*>(const_cast<FileAttributeMatcher*>(this)));
89 }
90
91 void FileAttributeMatcher::unreference() const
92 {
93   // See the comment at the top of this file, if you want to know why the cast works.
94   g_file_attribute_matcher_unref(reinterpret_cast<GFileAttributeMatcher*>(const_cast<FileAttributeMatcher*>(this)));
95 }
96
97 GFileAttributeMatcher* FileAttributeMatcher::gobj()
98 {
99   // See the comment at the top of this file, if you want to know why the cast works.
100   return reinterpret_cast<GFileAttributeMatcher*>(this);
101 }
102
103 const GFileAttributeMatcher* FileAttributeMatcher::gobj() const
104 {
105   // See the comment at the top of this file, if you want to know why the cast works.
106   return reinterpret_cast<const GFileAttributeMatcher*>(this);
107 }
108
109 GFileAttributeMatcher* FileAttributeMatcher::gobj_copy() const
110 {
111   // See the comment at the top of this file, if you want to know why the cast works.
112   GFileAttributeMatcher *const gobject = reinterpret_cast<GFileAttributeMatcher*>(const_cast<FileAttributeMatcher*>(this));
113   g_file_attribute_matcher_ref(gobject);
114   return gobject;
115 }
116
117
118 bool FileAttributeMatcher::matches(const std::string& full_name) const
119 {
120   return g_file_attribute_matcher_matches(const_cast<GFileAttributeMatcher*>(gobj()), full_name.c_str());
121 }
122
123 bool FileAttributeMatcher::matches_only(const std::string& full_name) const
124 {
125   return g_file_attribute_matcher_matches_only(const_cast<GFileAttributeMatcher*>(gobj()), full_name.c_str());
126 }
127
128 bool FileAttributeMatcher::enumerate_namespace(const std::string& ns)
129 {
130   return g_file_attribute_matcher_enumerate_namespace(gobj(), ns.c_str());
131 }
132
133 std::string FileAttributeMatcher::enumerate_next()
134 {
135   return Glib::convert_const_gchar_ptr_to_stdstring(g_file_attribute_matcher_enumerate_next(gobj()));
136 }
137
138
139 } // namespace Gio
140
141
142 namespace Glib
143 {
144
145 Glib::RefPtr<Gio::FileInfo> wrap(GFileInfo* object, bool take_copy)
146 {
147   return Glib::RefPtr<Gio::FileInfo>( dynamic_cast<Gio::FileInfo*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
148   //We use dynamic_cast<> in case of multiple inheritance.
149 }
150
151 } /* namespace Glib */
152
153
154 namespace Gio
155 {
156
157
158 /* The *_Class implementation: */
159
160 const Glib::Class& FileInfo_Class::init()
161 {
162   if(!gtype_) // create the GType if necessary
163   {
164     // Glib::Class has to know the class init function to clone custom types.
165     class_init_func_ = &FileInfo_Class::class_init_function;
166
167     // This is actually just optimized away, apparently with no harm.
168     // Make sure that the parent type has been created.
169     //CppClassParent::CppObjectType::get_type();
170
171     // Create the wrapper type, with the same class/instance size as the base type.
172     register_derived_type(g_file_info_get_type());
173
174     // Add derived versions of interfaces, if the C type implements any interfaces:
175
176   }
177
178   return *this;
179 }
180
181 void FileInfo_Class::class_init_function(void* g_class, void* class_data)
182 {
183   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
184   CppClassParent::class_init_function(klass, class_data);
185
186 #ifdef GLIBMM_VFUNCS_ENABLED
187 #endif //GLIBMM_VFUNCS_ENABLED
188
189 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
190 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
191 }
192
193 #ifdef GLIBMM_VFUNCS_ENABLED
194 #endif //GLIBMM_VFUNCS_ENABLED
195
196 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
197 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
198
199
200 Glib::ObjectBase* FileInfo_Class::wrap_new(GObject* object)
201 {
202   return new FileInfo((GFileInfo*)object);
203 }
204
205
206 /* The implementation: */
207
208 GFileInfo* FileInfo::gobj_copy()
209 {
210   reference();
211   return gobj();
212 }
213
214 FileInfo::FileInfo(const Glib::ConstructParams& construct_params)
215 :
216   Glib::Object(construct_params)
217 {
218
219 }
220
221 FileInfo::FileInfo(GFileInfo* castitem)
222 :
223   Glib::Object((GObject*)(castitem))
224 {}
225
226
227 FileInfo::~FileInfo()
228 {}
229
230
231 FileInfo::CppClassType FileInfo::fileinfo_class_; // initialize static member
232
233 GType FileInfo::get_type()
234 {
235   return fileinfo_class_.init().get_type();
236 }
237
238 GType FileInfo::get_base_type()
239 {
240   return g_file_info_get_type();
241 }
242
243 FileInfo::FileInfo()
244 :
245   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
246   Glib::ObjectBase(0),
247   Glib::Object(Glib::ConstructParams(fileinfo_class_.init()))
248 {
249   
250
251 }
252
253 Glib::RefPtr<FileInfo> FileInfo::dup() const
254 {
255   return Glib::wrap(g_file_info_dup(const_cast<GFileInfo*>(gobj())));
256 }
257
258 void FileInfo::copy_into(Glib::RefPtr<FileInfo>& dest) const
259 {
260 g_file_info_copy_into(const_cast<GFileInfo*>(gobj()), Glib::unwrap(dest)); 
261 }
262
263 bool FileInfo::has_attribute(const std::string& attribute) const
264 {
265   return g_file_info_has_attribute(const_cast<GFileInfo*>(gobj()), attribute.c_str());
266 }
267
268 Glib::StringArrayHandle FileInfo::list_attributes(const std::string& name_space) const
269 {
270   return Glib::StringArrayHandle(g_file_info_list_attributes(const_cast<GFileInfo*>(gobj()), name_space.c_str()));
271 }
272
273 FileAttributeType FileInfo::get_attribute_type(const std::string& attribute) const
274 {
275   return ((FileAttributeType)(g_file_info_get_attribute_type(const_cast<GFileInfo*>(gobj()), attribute.c_str())));
276 }
277
278 void FileInfo::remove_attribute(const std::string& attribute)
279 {
280 g_file_info_remove_attribute(gobj(), attribute.c_str()); 
281 }
282
283 std::string FileInfo::get_attribute_string(const std::string& attribute) const
284 {
285   return Glib::convert_const_gchar_ptr_to_stdstring(g_file_info_get_attribute_string(const_cast<GFileInfo*>(gobj()), attribute.c_str()));
286 }
287
288 Glib::ustring FileInfo::get_attribute_as_string(const std::string& attribute) const
289 {
290   return Glib::convert_return_gchar_ptr_to_ustring(g_file_info_get_attribute_as_string(const_cast<GFileInfo*>(gobj()), attribute.c_str()));
291 }
292
293 std::string FileInfo::get_attribute_byte_string(const std::string& attribute) const
294 {
295   return Glib::convert_const_gchar_ptr_to_stdstring(g_file_info_get_attribute_byte_string(const_cast<GFileInfo*>(gobj()), attribute.c_str()));
296 }
297
298 bool FileInfo::get_attribute_boolean(const std::string& attribute) const
299 {
300   return g_file_info_get_attribute_boolean(const_cast<GFileInfo*>(gobj()), attribute.c_str());
301 }
302
303 guint32 FileInfo::get_attribute_uint32(const std::string& attribute) const
304 {
305   return g_file_info_get_attribute_uint32(const_cast<GFileInfo*>(gobj()), attribute.c_str());
306 }
307
308 gint32 FileInfo::get_attribute_int32(const std::string& attribute) const
309 {
310   return g_file_info_get_attribute_int32(const_cast<GFileInfo*>(gobj()), attribute.c_str());
311 }
312
313 guint64 FileInfo::get_attribute_uint64(const std::string& attribute) const
314 {
315   return g_file_info_get_attribute_uint64(const_cast<GFileInfo*>(gobj()), attribute.c_str());
316 }
317
318 gint64 FileInfo::get_attribute_int64(const std::string& attribute) const
319 {
320   return g_file_info_get_attribute_int64(const_cast<GFileInfo*>(gobj()), attribute.c_str());
321 }
322
323 Glib::RefPtr<Glib::Object> FileInfo::get_attribute_object(const std::string& attribute) const
324 {
325   return Glib::wrap(g_file_info_get_attribute_object(const_cast<GFileInfo*>(gobj()), attribute.c_str()));
326 }
327
328 void FileInfo::set_attribute_string(const std::string& attribute, const std::string& value)
329 {
330 g_file_info_set_attribute_string(gobj(), attribute.c_str(), value.c_str()); 
331 }
332
333 void FileInfo::set_attribute_byte_string(const std::string& attribute, const std::string& value)
334 {
335 g_file_info_set_attribute_byte_string(gobj(), attribute.c_str(), value.c_str()); 
336 }
337
338 void FileInfo::set_attribute_boolean(const std::string& attribute, bool value)
339 {
340 g_file_info_set_attribute_boolean(gobj(), attribute.c_str(), static_cast<int>(value)); 
341 }
342
343 void FileInfo::set_attribute_uint32(const std::string& attribute, guint32 value)
344 {
345 g_file_info_set_attribute_uint32(gobj(), attribute.c_str(), value); 
346 }
347
348 void FileInfo::set_attribute_int32(const std::string& attribute, gint32 value)
349 {
350 g_file_info_set_attribute_int32(gobj(), attribute.c_str(), value); 
351 }
352
353 void FileInfo::set_attribute_uint64(const std::string& attribute, guint64 value)
354 {
355 g_file_info_set_attribute_uint64(gobj(), attribute.c_str(), value); 
356 }
357
358 void FileInfo::set_attribute_int64(const std::string& attribute, gint64 value)
359 {
360 g_file_info_set_attribute_int64(gobj(), attribute.c_str(), value); 
361 }
362
363 void FileInfo::set_attribute_object(const std::string& attribute, const Glib::RefPtr<Glib::Object>& object)
364 {
365 g_file_info_set_attribute_object(gobj(), attribute.c_str(), Glib::unwrap(object)); 
366 }
367
368 void FileInfo::clear_status()
369 {
370 g_file_info_clear_status(gobj()); 
371 }
372
373 FileType FileInfo::get_file_type() const
374 {
375   return ((FileType)(g_file_info_get_file_type(const_cast<GFileInfo*>(gobj()))));
376 }
377
378 bool FileInfo::is_hidden() const
379 {
380   return g_file_info_get_is_hidden(const_cast<GFileInfo*>(gobj()));
381 }
382
383 bool FileInfo::is_backup() const
384 {
385   return g_file_info_get_is_backup(const_cast<GFileInfo*>(gobj()));
386 }
387
388 bool FileInfo::is_symlink() const
389 {
390   return g_file_info_get_is_symlink(const_cast<GFileInfo*>(gobj()));
391 }
392
393 std::string FileInfo::get_name() const
394 {
395   return Glib::convert_const_gchar_ptr_to_stdstring(g_file_info_get_name(const_cast<GFileInfo*>(gobj())));
396 }
397
398 std::string FileInfo::get_display_name() const
399 {
400   return Glib::convert_const_gchar_ptr_to_stdstring(g_file_info_get_display_name(const_cast<GFileInfo*>(gobj())));
401 }
402
403 std::string FileInfo::get_edit_name() const
404 {
405   return Glib::convert_const_gchar_ptr_to_stdstring(g_file_info_get_edit_name(const_cast<GFileInfo*>(gobj())));
406 }
407
408 Glib::RefPtr<Icon> FileInfo::get_icon()
409 {
410
411   Glib::RefPtr<Icon> retvalue = Glib::wrap(g_file_info_get_icon(gobj()));
412   if(retvalue)
413     retvalue->reference(); //The function does not do a ref for us.
414   return retvalue;
415
416 }
417
418 Glib::RefPtr<const Icon> FileInfo::get_icon() const
419 {
420   return const_cast<FileInfo*>(this)->get_icon();
421 }
422
423 std::string FileInfo::get_content_type() const
424 {
425   return Glib::convert_const_gchar_ptr_to_stdstring(g_file_info_get_content_type(const_cast<GFileInfo*>(gobj())));
426 }
427
428 goffset FileInfo::get_size() const
429 {
430   return g_file_info_get_size(const_cast<GFileInfo*>(gobj()));
431 }
432
433 std::string FileInfo::get_symlink_target() const
434 {
435   return Glib::convert_const_gchar_ptr_to_stdstring(g_file_info_get_symlink_target(const_cast<GFileInfo*>(gobj())));
436 }
437
438 std::string FileInfo::get_etag() const
439 {
440   return Glib::convert_const_gchar_ptr_to_stdstring(g_file_info_get_etag(const_cast<GFileInfo*>(gobj())));
441 }
442
443 gint32 FileInfo::get_sort_order() const
444 {
445   return g_file_info_get_sort_order(const_cast<GFileInfo*>(gobj()));
446 }
447
448 void FileInfo::set_attribute_mask(const Glib::RefPtr<FileAttributeMatcher>& mask)
449 {
450 g_file_info_set_attribute_mask(gobj(), const_cast<GFileAttributeMatcher*>(Glib::unwrap(mask))); 
451 }
452
453 void FileInfo::unset_attribute_mask()
454 {
455 g_file_info_unset_attribute_mask(gobj()); 
456 }
457
458 void FileInfo::set_file_type(FileType type)
459 {
460 g_file_info_set_file_type(gobj(), ((GFileType)(type))); 
461 }
462
463 void FileInfo::set_is_hidden(bool is_hidden)
464 {
465 g_file_info_set_is_hidden(gobj(), static_cast<int>(is_hidden)); 
466 }
467
468 void FileInfo::set_is_symlink(bool is_symlink)
469 {
470 g_file_info_set_is_symlink(gobj(), static_cast<int>(is_symlink)); 
471 }
472
473 void FileInfo::set_name(const std::string& name)
474 {
475 g_file_info_set_name(gobj(), name.c_str()); 
476 }
477
478 void FileInfo::set_display_name(const std::string& display_name)
479 {
480 g_file_info_set_display_name(gobj(), display_name.c_str()); 
481 }
482
483 void FileInfo::set_edit_name(const std::string& edit_name)
484 {
485 g_file_info_set_edit_name(gobj(), edit_name.c_str()); 
486 }
487
488 void FileInfo::set_icon(const Glib::RefPtr<Icon>& icon)
489 {
490 g_file_info_set_icon(gobj(), const_cast<GIcon*>(Glib::unwrap(icon))); 
491 }
492
493 void FileInfo::set_content_type(const std::string& content_type)
494 {
495 g_file_info_set_content_type(gobj(), content_type.c_str()); 
496 }
497
498 void FileInfo::set_size(goffset size)
499 {
500 g_file_info_set_size(gobj(), size); 
501 }
502
503 void FileInfo::set_modification_time(const Glib::TimeVal& mtime)
504 {
505 g_file_info_set_modification_time(gobj(), const_cast<GTimeVal*>(static_cast<const GTimeVal*>(&mtime))); 
506 }
507
508 void FileInfo::set_symlink_target(const std::string& symlink_target)
509 {
510 g_file_info_set_symlink_target(gobj(), symlink_target.c_str()); 
511 }
512
513 void FileInfo::set_sort_order(gint32 sort_order)
514 {
515 g_file_info_set_sort_order(gobj(), sort_order); 
516 }
517
518
519 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
520 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
521
522 #ifdef GLIBMM_VFUNCS_ENABLED
523 #endif //GLIBMM_VFUNCS_ENABLED
524
525
526 } // namespace Gio
527
528