1 // Generated by gmmproc 2.64.2 -- DO NOT MODIFY!
2 
3 
4 #include <glibmm.h>
5 
6 #include <glibmm/module.h>
7 #include <glibmm/private/module_p.h>
8 
9 
10 /* Copyright (C) 2002 The gtkmm Development Team
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
24  */
25 
26 #include <glibmm/utility.h>
27 #include <gmodule.h>
28 
29 namespace Glib
30 {
31 
Module(const std::string & file_name,ModuleFlags flags)32 Module::Module(const std::string& file_name, ModuleFlags flags)
33 : gobject_(g_module_open(file_name.c_str(), (GModuleFlags)flags))
34 {
35 }
36 
Module(Module && other)37 Module::Module(Module&& other) noexcept : gobject_(std::move(other.gobject_))
38 {
39   other.gobject_ = nullptr;
40 }
41 
42 Module&
operator =(Module && other)43 Module::operator=(Module&& other) noexcept
44 {
45   if (gobject_)
46     g_module_close(gobject_);
47 
48   gobject_ = std::move(other.gobject_);
49   other.gobject_ = nullptr;
50 
51   return *this;
52 }
53 
~Module()54 Module::~Module()
55 {
56   if (gobject_)
57     g_module_close(gobject_);
58 }
59 
operator bool() const60 Module::operator bool() const
61 {
62   return (gobject_ != nullptr);
63 }
64 
65 } // namespace Glib
66 
67 namespace
68 {
69 } // anonymous namespace
70 
71 
72 namespace Glib
73 {
74 
75 
get_supported()76 bool Module::get_supported()
77 {
78   return g_module_supported();
79 }
80 
make_resident()81 void Module::make_resident()
82 {
83   g_module_make_resident(gobj());
84 }
85 
get_last_error()86 std::string Module::get_last_error()
87 {
88   return Glib::convert_const_gchar_ptr_to_stdstring(g_module_error());
89 }
90 
get_symbol(const std::string & symbol_name,void * & symbol) const91 bool Module::get_symbol(const std::string& symbol_name, void*& symbol) const
92 {
93   return g_module_symbol(const_cast<GModule*>(gobj()), symbol_name.c_str(), &(symbol));
94 }
95 
get_name() const96 std::string Module::get_name() const
97 {
98   return Glib::convert_const_gchar_ptr_to_stdstring(g_module_name(const_cast<GModule*>(gobj())));
99 }
100 
build_path(const std::string & directory,const std::string & module_name)101 std::string Module::build_path(const std::string& directory, const std::string& module_name)
102 {
103   return Glib::convert_return_gchar_ptr_to_stdstring(g_module_build_path(directory.c_str(), module_name.c_str()));
104 }
105 
106 
107 } // namespace Glib
108 
109 
110