1 // Generated by gmmproc 2.64.2 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <glibmm/keyfile.h>
7 #include <glibmm/private/keyfile_p.h>
8
9
10 /* Copyright 2006 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 namespace Glib
27 {
28
29 /**** Glib::KeyFile ********************************************************/
30
KeyFile()31 KeyFile::KeyFile()
32 {
33 gobject_ = g_key_file_new();
34 owns_gobject_ = true;
35 }
36
KeyFile(GKeyFile * castitem,bool takes_ownership)37 KeyFile::KeyFile(GKeyFile* castitem, bool takes_ownership)
38 {
39 gobject_ = castitem;
40 owns_gobject_ = takes_ownership;
41 }
42
KeyFile(KeyFile && other)43 KeyFile::KeyFile(KeyFile&& other) noexcept : gobject_(std::move(other.gobject_)),
44 owns_gobject_(std::move(other.owns_gobject_))
45 {
46 other.gobject_ = nullptr;
47 other.owns_gobject_ = false;
48 }
49
50 KeyFile&
operator =(KeyFile && other)51 KeyFile::operator=(KeyFile&& other) noexcept
52 {
53 if (owns_gobject_)
54 g_key_file_free(gobject_);
55
56 gobject_ = std::move(other.gobject_);
57 owns_gobject_ = std::move(other.owns_gobject_);
58
59 other.gobject_ = nullptr;
60 other.owns_gobject_ = false;
61
62 return *this;
63 }
64
~KeyFile()65 KeyFile::~KeyFile()
66 {
67 if (owns_gobject_)
68 g_key_file_free(gobject_);
69 }
70
71 bool
load_from_data(const Glib::ustring & data,KeyFileFlags flags)72 KeyFile::load_from_data(const Glib::ustring& data, KeyFileFlags flags)
73 {
74 GError* gerror = nullptr;
75
76 const gboolean result = g_key_file_load_from_data(
77 gobj(), data.c_str(), data.bytes(), static_cast<GKeyFileFlags>(unsigned(flags)), &gerror);
78
79 if (gerror)
80 Glib::Error::throw_exception(gerror);
81
82 return (result != 0);
83 }
84
85 bool
load_from_data_dirs(const std::string & file,std::string & full_path,KeyFileFlags flags)86 KeyFile::load_from_data_dirs(const std::string& file, std::string& full_path, KeyFileFlags flags)
87 {
88 GError* gerror = nullptr;
89 char* full_path_c = nullptr;
90
91 const gboolean result = g_key_file_load_from_data_dirs(
92 gobj(), file.c_str(), &full_path_c, static_cast<GKeyFileFlags>(unsigned(flags)), &gerror);
93
94 if (gerror)
95 Glib::Error::throw_exception(gerror);
96
97 if (full_path_c)
98 full_path = Glib::make_unique_ptr_gfree(full_path_c).get();
99 else
100 full_path.erase();
101
102 return (result != 0);
103 }
104
105 bool
load_from_dirs(const std::string & file,const Glib::ArrayHandle<std::string> & search_dirs,std::string & full_path,KeyFileFlags flags)106 KeyFile::load_from_dirs(const std::string& file, const Glib::ArrayHandle<std::string>& search_dirs,
107 std::string& full_path, KeyFileFlags flags)
108 {
109 GError* gerror = nullptr;
110 char* full_path_c = nullptr;
111
112 const gboolean result =
113 g_key_file_load_from_dirs(gobj(), file.c_str(), const_cast<const gchar**>(search_dirs.data()),
114 &full_path_c, static_cast<GKeyFileFlags>(unsigned(flags)), &gerror);
115
116 if (gerror)
117 {
118 if (full_path_c)
119 {
120 g_free(full_path_c);
121 }
122 Glib::Error::throw_exception(gerror);
123 }
124
125 if (full_path_c)
126 full_path = Glib::make_unique_ptr_gfree(full_path_c).get();
127 else
128 full_path.erase();
129
130 return (result != 0);
131 }
132
133 Glib::ustring
to_data()134 KeyFile::to_data()
135 {
136 GError* gerror = nullptr;
137 char* const str = g_key_file_to_data(gobj(), nullptr, &gerror);
138
139 if (gerror)
140 Glib::Error::throw_exception(gerror);
141
142 return Glib::convert_return_gchar_ptr_to_ustring(str);
143 }
144
145 Glib::ArrayHandle<Glib::ustring>
get_groups() const146 KeyFile::get_groups() const
147 {
148 gsize length = 0;
149 char** const array = g_key_file_get_groups(const_cast<GKeyFile*>(gobj()), &length);
150
151 return Glib::ArrayHandle<Glib::ustring>(array, length, Glib::OWNERSHIP_DEEP);
152 }
153
154 Glib::ArrayHandle<Glib::ustring>
get_keys(const Glib::ustring & group_name) const155 KeyFile::get_keys(const Glib::ustring& group_name) const
156 {
157 gsize length = 0;
158 GError* gerror = nullptr;
159
160 char** const array = g_key_file_get_keys(
161 const_cast<GKeyFile*>(gobj()), Glib::c_str_or_nullptr(group_name), &length, &gerror);
162
163 if (gerror)
164 Glib::Error::throw_exception(gerror);
165
166 return Glib::ArrayHandle<Glib::ustring>(array, length, Glib::OWNERSHIP_DEEP);
167 }
168
169 Glib::ustring
get_locale_string(const Glib::ustring & group_name,const Glib::ustring & key) const170 KeyFile::get_locale_string(const Glib::ustring& group_name, const Glib::ustring& key) const
171 {
172 GError* gerror = nullptr;
173 char* const str = g_key_file_get_locale_string(const_cast<GKeyFile*>(gobj()),
174 Glib::c_str_or_nullptr(group_name), key.c_str(), nullptr, &gerror);
175
176 if (gerror)
177 Glib::Error::throw_exception(gerror);
178
179 return Glib::convert_return_gchar_ptr_to_ustring(str);
180 }
181
182 bool
get_boolean(const Glib::ustring & key) const183 KeyFile::get_boolean(const Glib::ustring& key) const
184 {
185 GError* gerror = nullptr;
186 const bool value = static_cast<bool>(
187 g_key_file_get_boolean(const_cast<GKeyFile*>(gobj()), nullptr, key.c_str(), &gerror));
188 if (gerror)
189 Glib::Error::throw_exception(gerror);
190
191 return value;
192 }
193
194 int
get_integer(const Glib::ustring & key) const195 KeyFile::get_integer(const Glib::ustring& key) const
196 {
197 GError* gerror = nullptr;
198 const int value =
199 g_key_file_get_integer(const_cast<GKeyFile*>(gobj()), nullptr, key.c_str(), &gerror);
200 if (gerror)
201 Glib::Error::throw_exception(gerror);
202
203 return value;
204 }
205
206 gint64
get_int64(const Glib::ustring & key) const207 KeyFile::get_int64(const Glib::ustring& key) const
208 {
209 GError* gerror = nullptr;
210
211 const gint64 value =
212 g_key_file_get_int64(const_cast<GKeyFile*>(gobj()), nullptr, key.c_str(), &gerror);
213
214 if (gerror)
215 Glib::Error::throw_exception(gerror);
216
217 return value;
218 }
219
220 guint64
get_uint64(const Glib::ustring & key) const221 KeyFile::get_uint64(const Glib::ustring& key) const
222 {
223 GError* gerror = nullptr;
224
225 const guint64 value =
226 g_key_file_get_uint64(const_cast<GKeyFile*>(gobj()), nullptr, key.c_str(), &gerror);
227
228 if (gerror)
229 Glib::Error::throw_exception(gerror);
230
231 return value;
232 }
233
234 double
get_double(const Glib::ustring & key) const235 KeyFile::get_double(const Glib::ustring& key) const
236 {
237 GError* gerror = nullptr;
238 double retvalue =
239 g_key_file_get_double(const_cast<GKeyFile*>(gobj()), nullptr, key.c_str(), &(gerror));
240
241 if (gerror)
242 ::Glib::Error::throw_exception(gerror);
243
244 return retvalue;
245 }
246
247 void
set_double(const Glib::ustring & key,double value)248 KeyFile::set_double(const Glib::ustring& key, double value)
249 {
250 g_key_file_set_double(gobj(), nullptr, key.c_str(), value);
251 }
252
253 #define GLIBMM_ERROR_ARG
254 #define GLIBMM_THROW(err) \
255 if (err) \
256 Glib::Error::throw_exception(err)
257
258 Glib::ArrayHandle<Glib::ustring>
get_string_list(const Glib::ustring & group_name,const Glib::ustring & key GLIBMM_ERROR_ARG) const259 KeyFile::get_string_list(
260 const Glib::ustring& group_name, const Glib::ustring& key GLIBMM_ERROR_ARG) const
261 {
262 gsize length = 0;
263 GError* gerror = nullptr;
264
265 char** const array = g_key_file_get_string_list(const_cast<GKeyFile*>(gobj()),
266 Glib::c_str_or_nullptr(group_name), key.c_str(), &length, &gerror);
267
268 GLIBMM_THROW(gerror);
269
270 return Glib::ArrayHandle<Glib::ustring>(array, length, Glib::OWNERSHIP_DEEP);
271 }
272
273 Glib::ArrayHandle<Glib::ustring>
get_locale_string_list(const Glib::ustring & group_name,const Glib::ustring & key,const Glib::ustring & locale GLIBMM_ERROR_ARG) const274 KeyFile::get_locale_string_list(const Glib::ustring& group_name, const Glib::ustring& key,
275 const Glib::ustring& locale GLIBMM_ERROR_ARG) const
276 {
277 gsize length = 0;
278 GError* gerror = nullptr;
279
280 char** const array = g_key_file_get_locale_string_list(const_cast<GKeyFile*>(gobj()),
281 Glib::c_str_or_nullptr(group_name), key.c_str(), locale.c_str(), &length, &gerror);
282
283 GLIBMM_THROW(gerror);
284
285 return Glib::ArrayHandle<Glib::ustring>(array, length, Glib::OWNERSHIP_DEEP);
286 }
287
288 Glib::ArrayHandle<bool>
get_boolean_list(const Glib::ustring & group_name,const Glib::ustring & key GLIBMM_ERROR_ARG) const289 KeyFile::get_boolean_list(
290 const Glib::ustring& group_name, const Glib::ustring& key GLIBMM_ERROR_ARG) const
291 {
292 gsize length = 0;
293 GError* gerror = nullptr;
294
295 gboolean* const array = g_key_file_get_boolean_list(const_cast<GKeyFile*>(gobj()),
296 Glib::c_str_or_nullptr(group_name), key.c_str(), &length, &gerror);
297
298 GLIBMM_THROW(gerror);
299
300 return Glib::ArrayHandle<bool>(array, length, Glib::OWNERSHIP_SHALLOW);
301 }
302
303 Glib::ArrayHandle<int>
get_integer_list(const Glib::ustring & group_name,const Glib::ustring & key GLIBMM_ERROR_ARG) const304 KeyFile::get_integer_list(
305 const Glib::ustring& group_name, const Glib::ustring& key GLIBMM_ERROR_ARG) const
306 {
307 gsize length = 0;
308 GError* gerror = nullptr;
309
310 int* const array = g_key_file_get_integer_list(const_cast<GKeyFile*>(gobj()),
311 Glib::c_str_or_nullptr(group_name), key.c_str(), &length, &gerror);
312
313 GLIBMM_THROW(gerror);
314
315 return Glib::ArrayHandle<int>(array, length, Glib::OWNERSHIP_SHALLOW);
316 }
317
318 Glib::ArrayHandle<double>
get_double_list(const Glib::ustring & group_name,const Glib::ustring & key GLIBMM_ERROR_ARG) const319 KeyFile::get_double_list(
320 const Glib::ustring& group_name, const Glib::ustring& key GLIBMM_ERROR_ARG) const
321 {
322 gsize length = 0;
323 GError* gerror = nullptr;
324
325 double* const array = g_key_file_get_double_list(
326 const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), &length, &gerror);
327 GLIBMM_THROW(gerror);
328
329 return Glib::ArrayHandle<double>(array, length, Glib::OWNERSHIP_SHALLOW);
330 }
331
332 void
set_string_list(const Glib::ustring & group_name,const Glib::ustring & key,const Glib::ArrayHandle<Glib::ustring> & list)333 KeyFile::set_string_list(const Glib::ustring& group_name, const Glib::ustring& key,
334 const Glib::ArrayHandle<Glib::ustring>& list)
335 {
336 g_key_file_set_string_list(
337 gobj(), Glib::c_str_or_nullptr(group_name), key.c_str(), list.data(), list.size());
338 }
339
340 void
set_locale_string_list(const Glib::ustring & group_name,const Glib::ustring & key,const Glib::ustring & locale,const Glib::ArrayHandle<Glib::ustring> & list)341 KeyFile::set_locale_string_list(const Glib::ustring& group_name, const Glib::ustring& key,
342 const Glib::ustring& locale, const Glib::ArrayHandle<Glib::ustring>& list)
343 {
344 g_key_file_set_locale_string_list(gobj(), Glib::c_str_or_nullptr(group_name), key.c_str(),
345 locale.c_str(), list.data(), list.size());
346 }
347
348 void
set_integer_list(const Glib::ustring & group_name,const Glib::ustring & key,const Glib::ArrayHandle<int> & list)349 KeyFile::set_integer_list(
350 const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ArrayHandle<int>& list)
351 {
352 g_key_file_set_integer_list(gobj(), Glib::c_str_or_nullptr(group_name), key.c_str(),
353 const_cast<int*>(list.data()), list.size());
354 }
355
356 void
set_double_list(const Glib::ustring & group_name,const Glib::ustring & key,const Glib::ArrayHandle<double> & list)357 KeyFile::set_double_list(
358 const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ArrayHandle<double>& list)
359 {
360 g_key_file_set_double_list(
361 gobj(), group_name.c_str(), key.c_str(), const_cast<double*>(list.data()), list.size());
362 }
363
364 void
set_boolean_list(const Glib::ustring & group_name,const Glib::ustring & key,const Glib::ArrayHandle<bool> & list)365 KeyFile::set_boolean_list(
366 const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ArrayHandle<bool>& list)
367 {
368 g_key_file_set_boolean_list(gobj(), Glib::c_str_or_nullptr(group_name), key.c_str(),
369 const_cast<gboolean*>(list.data()), list.size());
370 }
371
372 Glib::ustring
get_comment() const373 KeyFile::get_comment() const
374 {
375 GError* gerror = nullptr;
376 char* const str =
377 g_key_file_get_comment(const_cast<GKeyFile*>(gobj()), nullptr, nullptr, &gerror);
378
379 GLIBMM_THROW(gerror);
380
381 return Glib::convert_return_gchar_ptr_to_ustring(str);
382 }
383
384 Glib::ustring
get_comment(const Glib::ustring & group_name GLIBMM_ERROR_ARG) const385 KeyFile::get_comment(const Glib::ustring& group_name GLIBMM_ERROR_ARG) const
386 {
387 GError* gerror = nullptr;
388 char* const str = g_key_file_get_comment(
389 const_cast<GKeyFile*>(gobj()), Glib::c_str_or_nullptr(group_name), nullptr, &gerror);
390 GLIBMM_THROW(gerror);
391
392 return Glib::convert_return_gchar_ptr_to_ustring(str);
393 }
394
395 void
set_comment(const Glib::ustring & comment GLIBMM_ERROR_ARG)396 KeyFile::set_comment(const Glib::ustring& comment GLIBMM_ERROR_ARG)
397 {
398 GError* gerror = nullptr;
399 g_key_file_set_comment(gobj(), nullptr, nullptr, comment.c_str(), &gerror);
400
401 GLIBMM_THROW(gerror);
402 }
403
404 void
set_comment(const Glib::ustring & group_name,const Glib::ustring & comment GLIBMM_ERROR_ARG)405 KeyFile::set_comment(const Glib::ustring& group_name, const Glib::ustring& comment GLIBMM_ERROR_ARG)
406 {
407 GError* gerror = nullptr;
408 g_key_file_set_comment(
409 gobj(), Glib::c_str_or_nullptr(group_name), nullptr, comment.c_str(), &gerror);
410 GLIBMM_THROW(gerror);
411 }
412
413 } // namespace Glib
414
415 namespace
416 {
417 } // anonymous namespace
418
419
KeyFileError(Glib::KeyFileError::Code error_code,const Glib::ustring & error_message)420 Glib::KeyFileError::KeyFileError(Glib::KeyFileError::Code error_code, const Glib::ustring& error_message)
421 :
422 Glib::Error (G_KEY_FILE_ERROR, error_code, error_message)
423 {}
424
KeyFileError(GError * gobject)425 Glib::KeyFileError::KeyFileError(GError* gobject)
426 :
427 Glib::Error (gobject)
428 {}
429
code() const430 Glib::KeyFileError::Code Glib::KeyFileError::code() const
431 {
432 return static_cast<Code>(Glib::Error::code());
433 }
434
throw_func(GError * gobject)435 void Glib::KeyFileError::throw_func(GError* gobject)
436 {
437 throw Glib::KeyFileError(gobject);
438 }
439
440
441 namespace Glib
442 {
443
444
load_from_file(const std::string & file,KeyFileFlags flags)445 bool KeyFile::load_from_file(const std::string& file, KeyFileFlags flags)
446 {
447 GError* gerror = nullptr;
448 bool retvalue = g_key_file_load_from_file(gobj(), file.c_str(), ((GKeyFileFlags)(flags)), &(gerror));
449 if(gerror)
450 ::Glib::Error::throw_exception(gerror);
451 return retvalue;
452 }
453
454 #ifndef GLIBMM_DISABLE_DEPRECATED
455 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
load_from_dirs(const std::string & file,const Glib::ArrayHandle<std::string> & search_dirs,Glib::ArrayHandle<std::string> & full_path,KeyFileFlags flags)456 bool KeyFile::load_from_dirs(const std::string& file, const Glib::ArrayHandle<std::string>& search_dirs, Glib::ArrayHandle<std::string>& full_path, KeyFileFlags flags)
457 {
458 GError* gerror = nullptr;
459 bool retvalue = g_key_file_load_from_dirs(gobj(), file.c_str(), const_cast<const gchar**>(search_dirs.data()), const_cast<gchar**>(full_path.data()), ((GKeyFileFlags)(flags)), &(gerror));
460 if(gerror)
461 ::Glib::Error::throw_exception(gerror);
462 return retvalue;
463 }
464 G_GNUC_END_IGNORE_DEPRECATIONS
465 #endif // GLIBMM_DISABLE_DEPRECATED
466
save_to_file(const std::string & filename)467 bool KeyFile::save_to_file(const std::string& filename)
468 {
469 GError* gerror = nullptr;
470 bool retvalue = g_key_file_save_to_file(gobj(), filename.c_str(), &(gerror));
471 if(gerror)
472 ::Glib::Error::throw_exception(gerror);
473 return retvalue;
474 }
475
get_start_group() const476 Glib::ustring KeyFile::get_start_group() const
477 {
478 return Glib::convert_return_gchar_ptr_to_ustring(g_key_file_get_start_group(const_cast<GKeyFile*>(gobj())));
479 }
480
has_group(const Glib::ustring & group_name) const481 bool KeyFile::has_group(const Glib::ustring& group_name) const
482 {
483 return g_key_file_has_group(const_cast<GKeyFile*>(gobj()), group_name.c_str());
484 }
485
has_key(const Glib::ustring & group_name,const Glib::ustring & key) const486 bool KeyFile::has_key(const Glib::ustring& group_name, const Glib::ustring& key) const
487 {
488 GError* gerror = nullptr;
489 bool retvalue = g_key_file_has_key(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), &(gerror));
490 if(gerror)
491 ::Glib::Error::throw_exception(gerror);
492 return retvalue;
493 }
494
get_value(const Glib::ustring & group_name,const Glib::ustring & key) const495 Glib::ustring KeyFile::get_value(const Glib::ustring& group_name, const Glib::ustring& key) const
496 {
497 GError* gerror = nullptr;
498 Glib::ustring retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_key_file_get_value(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), &(gerror)));
499 if(gerror)
500 ::Glib::Error::throw_exception(gerror);
501 return retvalue;
502 }
503
get_string(const Glib::ustring & group_name,const Glib::ustring & key) const504 Glib::ustring KeyFile::get_string(const Glib::ustring& group_name, const Glib::ustring& key) const
505 {
506 GError* gerror = nullptr;
507 Glib::ustring retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_key_file_get_string(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), &(gerror)));
508 if(gerror)
509 ::Glib::Error::throw_exception(gerror);
510 return retvalue;
511 }
512
get_locale_for_key(const Glib::ustring & group_name,const Glib::ustring & key,const Glib::ustring & locale) const513 Glib::ustring KeyFile::get_locale_for_key(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ustring& locale) const
514 {
515 return Glib::convert_return_gchar_ptr_to_ustring(g_key_file_get_locale_for_key(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), locale.empty() ? nullptr : locale.c_str()));
516 }
517
get_locale_string(const Glib::ustring & group_name,const Glib::ustring & key,const Glib::ustring & locale) const518 Glib::ustring KeyFile::get_locale_string(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ustring& locale) const
519 {
520 GError* gerror = nullptr;
521 Glib::ustring retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_key_file_get_locale_string(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), locale.c_str(), &(gerror)));
522 if(gerror)
523 ::Glib::Error::throw_exception(gerror);
524 return retvalue;
525 }
526
get_boolean(const Glib::ustring & group_name,const Glib::ustring & key) const527 bool KeyFile::get_boolean(const Glib::ustring& group_name, const Glib::ustring& key) const
528 {
529 GError* gerror = nullptr;
530 bool retvalue = g_key_file_get_boolean(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), &(gerror));
531 if(gerror)
532 ::Glib::Error::throw_exception(gerror);
533 return retvalue;
534 }
535
get_integer(const Glib::ustring & group_name,const Glib::ustring & key) const536 int KeyFile::get_integer(const Glib::ustring& group_name, const Glib::ustring& key) const
537 {
538 GError* gerror = nullptr;
539 int retvalue = g_key_file_get_integer(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), &(gerror));
540 if(gerror)
541 ::Glib::Error::throw_exception(gerror);
542 return retvalue;
543 }
544
get_int64(const Glib::ustring & group_name,const Glib::ustring & key) const545 gint64 KeyFile::get_int64(const Glib::ustring& group_name, const Glib::ustring& key) const
546 {
547 GError* gerror = nullptr;
548 gint64 retvalue = g_key_file_get_int64(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), &(gerror));
549 if(gerror)
550 ::Glib::Error::throw_exception(gerror);
551 return retvalue;
552 }
553
get_uint64(const Glib::ustring & group_name,const Glib::ustring & key) const554 guint64 KeyFile::get_uint64(const Glib::ustring& group_name, const Glib::ustring& key) const
555 {
556 GError* gerror = nullptr;
557 guint64 retvalue = g_key_file_get_uint64(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), &(gerror));
558 if(gerror)
559 ::Glib::Error::throw_exception(gerror);
560 return retvalue;
561 }
562
get_double(const Glib::ustring & group_name,const Glib::ustring & key) const563 double KeyFile::get_double(const Glib::ustring& group_name, const Glib::ustring& key) const
564 {
565 GError* gerror = nullptr;
566 double retvalue = g_key_file_get_double(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), &(gerror));
567 if(gerror)
568 ::Glib::Error::throw_exception(gerror);
569 return retvalue;
570 }
571
set_double(const Glib::ustring & group_name,const Glib::ustring & key,double value)572 void KeyFile::set_double(const Glib::ustring& group_name, const Glib::ustring& key, double value)
573 {
574 g_key_file_set_double(gobj(), group_name.c_str(), key.c_str(), value);
575 }
576
get_comment(const Glib::ustring & group_name,const Glib::ustring & key) const577 Glib::ustring KeyFile::get_comment(const Glib::ustring& group_name, const Glib::ustring& key) const
578 {
579 GError* gerror = nullptr;
580 Glib::ustring retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_key_file_get_comment(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), &(gerror)));
581 if(gerror)
582 ::Glib::Error::throw_exception(gerror);
583 return retvalue;
584 }
585
set_list_separator(gchar separator)586 void KeyFile::set_list_separator(gchar separator)
587 {
588 g_key_file_set_list_separator(gobj(), separator);
589 }
590
set_value(const Glib::ustring & group_name,const Glib::ustring & key,const Glib::ustring & value)591 void KeyFile::set_value(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ustring& value)
592 {
593 g_key_file_set_value(gobj(), group_name.c_str(), key.c_str(), value.c_str());
594 }
595
set_string(const Glib::ustring & group_name,const Glib::ustring & key,const Glib::ustring & string)596 void KeyFile::set_string(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ustring& string)
597 {
598 g_key_file_set_string(gobj(), group_name.c_str(), key.c_str(), string.c_str());
599 }
600
set_locale_string(const Glib::ustring & group_name,const Glib::ustring & key,const Glib::ustring & locale,const Glib::ustring & string)601 void KeyFile::set_locale_string(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ustring& locale, const Glib::ustring& string)
602 {
603 g_key_file_set_locale_string(gobj(), group_name.c_str(), key.c_str(), locale.c_str(), string.c_str());
604 }
605
set_boolean(const Glib::ustring & group_name,const Glib::ustring & key,bool value)606 void KeyFile::set_boolean(const Glib::ustring& group_name, const Glib::ustring& key, bool value)
607 {
608 g_key_file_set_boolean(gobj(), group_name.c_str(), key.c_str(), static_cast<int>(value));
609 }
610
set_integer(const Glib::ustring & group_name,const Glib::ustring & key,int value)611 void KeyFile::set_integer(const Glib::ustring& group_name, const Glib::ustring& key, int value)
612 {
613 g_key_file_set_integer(gobj(), group_name.c_str(), key.c_str(), value);
614 }
615
set_int64(const Glib::ustring & group_name,const Glib::ustring & key,gint64 value)616 void KeyFile::set_int64(const Glib::ustring& group_name, const Glib::ustring& key, gint64 value)
617 {
618 g_key_file_set_int64(gobj(), group_name.c_str(), key.c_str(), value);
619 }
620
set_uint64(const Glib::ustring & group_name,const Glib::ustring & key,guint64 value)621 void KeyFile::set_uint64(const Glib::ustring& group_name, const Glib::ustring& key, guint64 value)
622 {
623 g_key_file_set_uint64(gobj(), group_name.c_str(), key.c_str(), value);
624 }
625
set_comment(const Glib::ustring & group_name,const Glib::ustring & key,const Glib::ustring & comment)626 void KeyFile::set_comment(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ustring& comment)
627 {
628 GError* gerror = nullptr;
629 g_key_file_set_comment(gobj(), group_name.c_str(), key.c_str(), comment.c_str(), &(gerror));
630 if(gerror)
631 ::Glib::Error::throw_exception(gerror);
632 }
633
remove_comment(const Glib::ustring & group_name,const Glib::ustring & key)634 void KeyFile::remove_comment(const Glib::ustring& group_name, const Glib::ustring& key)
635 {
636 GError* gerror = nullptr;
637 g_key_file_remove_comment(gobj(), group_name.c_str(), key.c_str(), &(gerror));
638 if(gerror)
639 ::Glib::Error::throw_exception(gerror);
640 }
641
remove_key(const Glib::ustring & group_name,const Glib::ustring & key)642 void KeyFile::remove_key(const Glib::ustring& group_name, const Glib::ustring& key)
643 {
644 GError* gerror = nullptr;
645 g_key_file_remove_key(gobj(), group_name.c_str(), key.c_str(), &(gerror));
646 if(gerror)
647 ::Glib::Error::throw_exception(gerror);
648 }
649
remove_group(const Glib::ustring & group_name)650 void KeyFile::remove_group(const Glib::ustring& group_name)
651 {
652 GError* gerror = nullptr;
653 g_key_file_remove_group(gobj(), group_name.c_str(), &(gerror));
654 if(gerror)
655 ::Glib::Error::throw_exception(gerror);
656 }
657
658
659 } // namespace Glib
660
661
662