~ubuntu-branches/ubuntu/trusty/libgdamm5.0/trusty

« back to all changes in this revision

Viewing changes to libgda/libgdamm/quarklist.cc

  • Committer: Package Import Robot
  • Author(s): Daniel Holbach
  • Date: 2012-02-07 16:44:36 UTC
  • Revision ID: package-import@ubuntu.com-20120207164436-j1odzs6zz6gz2vae
Tags: upstream-4.99.6
ImportĀ upstreamĀ versionĀ 4.99.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Generated by gtkmmproc -- DO NOT MODIFY!
 
2
 
 
3
 
 
4
#include <glibmm.h>
 
5
 
 
6
#include <libgdamm/quarklist.h>
 
7
#include <libgdamm/private/quarklist_p.h>
 
8
 
 
9
 
 
10
// -*- C++ -*- //
 
11
 
 
12
/* quarklist.ccg
 
13
 *
 
14
 * Copyright 2001      Free Software Foundation
 
15
 *
 
16
 * This library is free software; you can redistribute it and/or
 
17
 * modify it under the terms of the GNU Lesser General Public
 
18
 * License as published by the Free Software Foundation; either
 
19
 * version 2.1 of the License, or (at your option) any later version.
 
20
 *
 
21
 * This library is distributed in the hope that it will be useful,
 
22
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
23
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
24
 * Lesser General Public License for more details.
 
25
 *
 
26
 * You should have received a copy of the GNU Lesser General Public
 
27
 * License along with this library; if not, write to the Free
 
28
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
29
 */
 
30
 
 
31
#include <libgda/gda-quark-list.h>
 
32
 
 
33
namespace
 
34
{
 
35
static void quarklist_foreach_callback(gpointer ckey, gpointer cvalue, void* data)
 
36
{
 
37
  try
 
38
  {
 
39
    Gnome::Gda::QuarkList::ForeachSlot& slot = *static_cast<Gnome::Gda::QuarkList::ForeachSlot*>(data);
 
40
    Glib::ustring key(static_cast<gchar*>(ckey));
 
41
    Glib::ustring value(static_cast<gchar*>(cvalue));
 
42
 
 
43
    slot(key, value);
 
44
  }
 
45
  catch(...)
 
46
  {
 
47
    Glib::exception_handlers_invoke();
 
48
  }
 
49
 
50
}
 
51
 
 
52
namespace Gnome
 
53
{
 
54
 
 
55
namespace Gda
 
56
{  
 
57
 
 
58
void QuarkList::foreach(const QuarkList::ForeachSlot& slot)
 
59
{
 
60
  ForeachSlot slot_copy (slot);
 
61
  gda_quark_list_foreach(gobj(), &quarklist_foreach_callback, &slot_copy);
 
62
}
 
63
 
 
64
} // namespace Gda
 
65
 
 
66
} // namesoace Gnome
 
67
 
 
68
namespace
 
69
{
 
70
} // anonymous namespace
 
71
 
 
72
 
 
73
namespace Glib
 
74
{
 
75
 
 
76
Gnome::Gda::QuarkList wrap(GdaQuarkList* object, bool take_copy)
 
77
{
 
78
  return Gnome::Gda::QuarkList(object, take_copy);
 
79
}
 
80
 
 
81
} // namespace Glib
 
82
 
 
83
 
 
84
namespace Gnome
 
85
{
 
86
 
 
87
namespace Gda
 
88
{
 
89
 
 
90
 
 
91
// static
 
92
GType QuarkList::get_type()
 
93
{
 
94
  return gda_quark_list_get_type();
 
95
}
 
96
 
 
97
QuarkList::QuarkList()
 
98
:
 
99
  gobject_ (gda_quark_list_new())
 
100
{}
 
101
 
 
102
QuarkList::QuarkList(const QuarkList& other)
 
103
:
 
104
  gobject_ ((other.gobject_) ? gda_quark_list_copy(other.gobject_) : 0)
 
105
{}
 
106
 
 
107
QuarkList::QuarkList(GdaQuarkList* gobject, bool make_a_copy)
 
108
:
 
109
  // For BoxedType wrappers, make_a_copy is true by default.  The static
 
110
  // BoxedType wrappers must always take a copy, thus make_a_copy = true
 
111
  // ensures identical behaviour if the default argument is used.
 
112
  gobject_ ((make_a_copy && gobject) ? gda_quark_list_copy(gobject) : gobject)
 
113
{}
 
114
 
 
115
QuarkList& QuarkList::operator=(const QuarkList& other)
 
116
{
 
117
  QuarkList temp (other);
 
118
  swap(temp);
 
119
  return *this;
 
120
}
 
121
 
 
122
QuarkList::~QuarkList()
 
123
{
 
124
  if(gobject_)
 
125
    gda_quark_list_free(gobject_);
 
126
}
 
127
 
 
128
void QuarkList::swap(QuarkList& other)
 
129
{
 
130
  GdaQuarkList *const temp = gobject_;
 
131
  gobject_ = other.gobject_;
 
132
  other.gobject_ = temp;
 
133
}
 
134
 
 
135
GdaQuarkList* QuarkList::gobj_copy() const
 
136
{
 
137
  return gda_quark_list_copy(gobject_);
 
138
}
 
139
 
 
140
 
 
141
void QuarkList::clear()
 
142
{
 
143
gda_quark_list_clear(gobj()); 
 
144
}
 
145
 
 
146
void QuarkList::add_from_string(const Glib::ustring& name, bool cleanup)
 
147
{
 
148
gda_quark_list_add_from_string(gobj(), name.c_str(), static_cast<int>(cleanup)); 
 
149
}
 
150
 
 
151
Glib::ustring QuarkList::find(const Glib::ustring& name) const
 
152
{
 
153
  return Glib::convert_const_gchar_ptr_to_ustring(gda_quark_list_find(const_cast<GdaQuarkList*>(gobj()), name.c_str()));
 
154
}
 
155
 
 
156
void QuarkList::remove(const Glib::ustring& name)
 
157
{
 
158
gda_quark_list_remove(gobj(), name.c_str()); 
 
159
}
 
160
 
 
161
 
 
162
} // namespace Gda
 
163
 
 
164
} // namespace Gnome
 
165
 
 
166