1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <glibmm/module.h>
4 #include <glibmm/private/module_p.h>
9 /* Copyright (C) 2002 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.
26 #include <glibmm/utility.h>
32 Module::Module(const std::string& file_name, ModuleFlags flags)
34 gobject_ (g_module_open(file_name.c_str(), (GModuleFlags) flags))
40 g_module_close(gobject_);
43 Module::operator bool() const
45 return (gobject_ != 0);
53 } // anonymous namespace
60 bool Module::get_supported()
62 return g_module_supported();
65 void Module::make_resident()
67 g_module_make_resident(gobj());
70 std::string Module::get_last_error()
72 return Glib::convert_const_gchar_ptr_to_stdstring(g_module_error());
75 bool Module::get_symbol(const std::string& symbol_name, void*& symbol) const
77 return g_module_symbol(const_cast<GModule*>(gobj()), symbol_name.c_str(), &(symbol));
80 std::string Module::get_name() const
82 return Glib::convert_const_gchar_ptr_to_stdstring(g_module_name(const_cast<GModule*>(gobj())));
85 std::string Module::build_path(const std::string& directory, const std::string& module_name)
87 return Glib::convert_return_gchar_ptr_to_stdstring(g_module_build_path(directory.c_str(), module_name.c_str()));