1 // Generated by gtkmmproc -- DO NOT MODIFY!
4 #include <glibmm/optionentry.h>
5 #include <glibmm/private/optionentry_p.h>
10 /* Copyright (C) 2002 The gtkmm Development Team
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
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 * Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with this library; if not, write to the Free
24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 #include <glibmm/utility.h>
28 #include <glib/goption.h>
29 #include <glib/gmem.h>
34 OptionEntry::OptionEntry()
36 gobject_ = g_new0(GOptionEntry, 1);
39 OptionEntry::~OptionEntry()
41 g_free(const_cast<char*>(gobject_->long_name));
42 g_free(const_cast<char*>(gobject_->description));
43 g_free(const_cast<char*>(gobject_->arg_description));
47 OptionEntry::OptionEntry(const OptionEntry& src)
49 gobject_ = g_new0(GOptionEntry, 1);
54 OptionEntry& OptionEntry::operator=(const OptionEntry& src)
58 if(gobject_->long_name)
59 g_free(const_cast<char*>(gobject_->long_name));
61 gobject_->long_name = g_strdup(src.gobject_->long_name);
63 gobject_->short_name = src.gobject_->short_name; //It's just one char.
65 gobject_->flags = src.gobject_->flags;
66 gobject_->arg = src.gobject_->arg;
67 gobject_->arg_data = src.gobject_->arg_data; //Shared, because it's not owned by any instance of this class anyway.
69 if(gobject_->description)
70 g_free(const_cast<char*>(gobject_->description));
72 gobject_->description = g_strdup(src.gobject_->description);
74 if(gobject_->arg_description)
75 g_free(const_cast<char*>(gobject_->arg_description));
77 gobject_->arg_description = g_strdup(src.gobject_->arg_description);
89 } // anonymous namespace
96 Glib::ustring OptionEntry::get_long_name() const
98 return Glib::convert_const_gchar_ptr_to_ustring(gobj()->long_name);
101 void OptionEntry::set_long_name(const Glib::ustring& value)
103 gobj()->long_name = g_strdup((value).c_str());
106 gchar OptionEntry::get_short_name() const
108 return gobj()->short_name;
111 void OptionEntry::set_short_name(const gchar& value)
113 gobj()->short_name = value;
116 int OptionEntry::get_flags() const
118 return gobj()->flags;
121 void OptionEntry::set_flags(const int& value)
123 gobj()->flags = value;
126 Glib::ustring OptionEntry::get_description() const
128 return Glib::convert_const_gchar_ptr_to_ustring(gobj()->description);
131 void OptionEntry::set_description(const Glib::ustring& value)
133 gobj()->description = g_strdup((value).c_str());
136 Glib::ustring OptionEntry::get_arg_description() const
138 return Glib::convert_const_gchar_ptr_to_ustring(gobj()->arg_description);
141 void OptionEntry::set_arg_description(const Glib::ustring& value)
143 gobj()->arg_description = g_strdup((value).c_str());