alternative to assert
[gtkD.git] / src / glib / GKeyFile.d
blob62f35bae5d743496f41ed96eeebb6f5209be364b
1 /*
2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = glib-Key-value-file-parser.html
26 * outPack = glib
27 * outFile = GKeyFile
28 * strct = GKeyFile
29 * realStrct=
30 * ctorStrct=
31 * clss = KeyFile
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - g_key_file_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glib.ErrorG
45 * - glib.Str
46 * structWrap:
47 * local aliases:
50 module glib.GKeyFile;
52 private import glib.glibtypes;
54 private import lib.glib;
56 private import glib.ErrorG;
57 private import glib.Str;
59 /**
60 * Description
61 * GKeyFile lets you parse, edit or create files containing groups of
62 * key-value pairs, which we call key files for
63 * lack of a better name. Several freedesktop.org specifications use
64 * key files now, e.g the
65 * Desktop
66 * Entry Specification and the
67 * Icon
68 * Theme Specification.
69 * The syntax of key files is described in detail in the
70 * Desktop
71 * Entry Specification, here is a quick summary: Key files
72 * consists of groups of key-value pairs, interspersed with comments.
73 * # this is just an example
74 * # there can be comments before the first group
75 * [First Group]
76 * Name=Key File Example\tthis value shows\nescaping
77 * # localized strings are stored in multiple key-value pairs
78 * Welcome=Hello
79 * Welcome[de]=Hallo
80 * Welcome[fr]=Bonjour
81 * Welcome[it]=Ciao
82 * [Another Group]
83 * Numbers=2;20;-200;0
84 * Booleans=true;false;true;true
85 * Lines beginning with a '#' and blank lines are considered comments.
86 * Groups are started by a header line containing the group name enclosed
87 * in '[' and ']', and ended implicitly by the start of the next group or
88 * the end of the file. Each key-value pair must be contained in a group.
89 * Key-value pairs generally have the form key=value,
90 * with the exception of localized strings, which have the form
91 * key[locale]=value. Space before and after the
92 * '=' character are ignored. Newline, tab, carriage return and backslash
93 * characters are escaped as \n, \t, \r, and \\, respectively. To preserve
94 * initial and final spaces, these can also be escaped as \s.
95 * Key files can store strings (possibly with localized variants), integers,
96 * booleans and lists of these. Lists are separated by a separator character,
97 * typically ';' or ','. To use the list separator character in a value in
98 * a list, it has to be escaped by prefixing it with a backslash.
99 * This syntax is obviously inspired by the .ini
100 * files commonly met on Windows, but there are some important differences:
101 * .ini files use the ';' character to begin comments,
102 * key files use the '#' character.
103 * Key files allow only comments before the first group.
104 * Key files are always encoded in UTF-8.
105 * Key and Group names are case-sensitive, for example a group called
106 * [GROUP] is a different group from [group].
108 public class KeyFile
111 /** the main Gtk struct */
112 protected GKeyFile* gKeyFile;
115 public GKeyFile* getKeyFileStruct()
117 return gKeyFile;
121 /** the main Gtk struct as a void* */
122 protected void* getStruct()
124 return cast(void*)gKeyFile;
128 * Sets our main struct and passes it to the parent class
130 public this (GKeyFile* gKeyFile)
132 this.gKeyFile = gKeyFile;
143 * Creates a new empty GKeyFile object. Use g_key_file_load_from_file(),
144 * g_key_file_load_from_data() or g_key_file_load_from_data_dirs() to
145 * read an existing key file.
146 * Returns:
147 * an empty GKeyFile.
148 * Since 2.6
150 public this ()
152 // GKeyFile* g_key_file_new (void);
153 this(cast(GKeyFile*)g_key_file_new() );
157 * Frees a GKeyFile.
158 * key_file:
159 * a GKeyFile
160 * Since 2.6
162 public void free()
164 // void g_key_file_free (GKeyFile *key_file);
165 g_key_file_free(gKeyFile);
169 * Sets the character which is used to separate
170 * values in lists. Typically ';' or ',' are used
171 * as separators. The default list separator is ';'.
172 * key_file:
173 * a GKeyFile
174 * separator:
175 * the separator
176 * Since 2.6
178 public void setListSeparator(char separator)
180 // void g_key_file_set_list_separator (GKeyFile *key_file, gchar separator);
181 g_key_file_set_list_separator(gKeyFile, separator);
185 * Loads a key file into an empty GKeyFile structure.
186 * If the file could not be loaded then error is set to
187 * either a GFileError or GKeyFileError.
188 * key_file:
189 * an empty GKeyFile struct
190 * file:
191 * the path of a filename to load, in the GLib file name encoding
192 * flags:
193 * flags from GKeyFileFlags
194 * error:
195 * return location for a GError, or NULL
196 * Returns:
197 * TRUE if a key file could be loaded, FALSE othewise
198 * Since 2.6
200 public int loadFromFile(char[] file, GKeyFileFlags flags, GError** error)
202 // gboolean g_key_file_load_from_file (GKeyFile *key_file, const gchar *file, GKeyFileFlags flags, GError **error);
203 return g_key_file_load_from_file(gKeyFile, Str.toStringz(file), flags, error);
207 * Loads a key file from memory into an empty GKeyFile structure. If
208 * the object cannot be created then error is set to a
209 * GKeyFileError.
210 * key_file:
211 * an empty GKeyFile struct
212 * data:
213 * key file loaded in memory.
214 * length:
215 * the length of data in bytes
216 * flags:
217 * flags from GKeyFileFlags
218 * error:
219 * return location for a GError, or NULL
220 * Returns:
221 * TRUE if a key file could be loaded, FALSE othewise
222 * Since 2.6
224 public int loadFromData(char[] data, uint length, GKeyFileFlags flags, GError** error)
226 // gboolean g_key_file_load_from_data (GKeyFile *key_file, const gchar *data, gsize length, GKeyFileFlags flags, GError **error);
227 return g_key_file_load_from_data(gKeyFile, Str.toStringz(data), length, flags, error);
231 * This function looks for a key file named file in the paths
232 * returned from g_get_user_data_dir() and g_get_system_data_dirs(),
233 * loads the file into key_file and returns the file's full path in
234 * full_path. If the file could not be loaded then an error is
235 * set to either a GFileError or GKeyFileError.
236 * key_file:
237 * an empty GKeyFile struct
238 * file:
239 * a relative path to a filename to open and parse
240 * full_path:
241 * return location for a string containing the full path
242 * of the file, or NULL
243 * flags:
244 * flags from GKeyFileFlags
245 * error:
246 * return location for a GError, or NULL
247 * Returns:
248 * TRUE if a key file could be loaded, FALSE othewise
249 * Since 2.6
251 public int loadFromDataDirs(char[] file, char** fullPath, GKeyFileFlags flags, GError** error)
253 // gboolean g_key_file_load_from_data_dirs (GKeyFile *key_file, const gchar *file, gchar **full_path, GKeyFileFlags flags, GError **error);
254 return g_key_file_load_from_data_dirs(gKeyFile, Str.toStringz(file), fullPath, flags, error);
258 * This function outputs key_file as a string.
259 * key_file:
260 * a GKeyFile
261 * length:
262 * return location for the length of the
263 * returned string, or NULL
264 * error:
265 * return location for a GError, or NULL
266 * Returns:
267 * a newly allocated string holding
268 * the contents of the GKeyFile
269 * Since 2.6
271 public char[] toData(uint* length, GError** error)
273 // gchar* g_key_file_to_data (GKeyFile *key_file, gsize *length, GError **error);
274 return Str.toString(g_key_file_to_data(gKeyFile, length, error) );
278 * Returns the name of the start group of the file.
279 * key_file:
280 * a GKeyFile
281 * Returns:
282 * The start group of the key file.
283 * Since 2.6
285 public char[] getStartGroup()
287 // gchar* g_key_file_get_start_group (GKeyFile *key_file);
288 return Str.toString(g_key_file_get_start_group(gKeyFile) );
292 * Returns all groups in the key file loaded with key_file. The
293 * array of returned groups will be NULL-terminated, so length may
294 * optionally be NULL.
295 * key_file:
296 * a GKeyFile
297 * length:
298 * return location for the number of returned groups, or NULL
299 * Returns:
300 * a newly-allocated NULL-terminated array of strings.
301 * Use g_strfreev() to free it.
302 * Since 2.6
304 public char** getGroups(uint* length)
306 // gchar** g_key_file_get_groups (GKeyFile *key_file, gsize *length);
307 return g_key_file_get_groups(gKeyFile, length);
311 * Returns all keys for the group name group_name. The array of
312 * returned keys will be NULL-terminated, so length may
313 * optionally be NULL. In the event that the group_name cannot
314 * be found, NULL is returned and error is set to
315 * G_KEY_FILE_ERROR_GROUP_NOT_FOUND.
316 * key_file:
317 * a GKeyFile
318 * group_name:
319 * a group name
320 * length:
321 * return location for the number of keys returned, or NULL
322 * error:
323 * return location for a GError, or NULL
324 * Returns:
325 * a newly-allocated NULL-terminated array of
326 * strings. Use g_strfreev() to free it.
327 * Since 2.6
329 public char** getKeys(char[] groupName, uint* length, GError** error)
331 // gchar** g_key_file_get_keys (GKeyFile *key_file, const gchar *group_name, gsize *length, GError **error);
332 return g_key_file_get_keys(gKeyFile, Str.toStringz(groupName), length, error);
336 * Looks whether the key file has the group group_name.
337 * key_file:
338 * a GKeyFile
339 * group_name:
340 * a group name
341 * Returns:
342 * TRUE if group_name is a part of key_file, FALSE
343 * otherwise.
344 * Since 2.6
346 public int hasGroup(char[] groupName)
348 // gboolean g_key_file_has_group (GKeyFile *key_file, const gchar *group_name);
349 return g_key_file_has_group(gKeyFile, Str.toStringz(groupName));
353 * Looks whether the key file has the key key in the group
354 * group_name.
355 * key_file:
356 * a GKeyFile
357 * group_name:
358 * a group name
359 * key:
360 * a key name
361 * error:
362 * return location for a GError
363 * Returns:
364 * TRUE if key is a part of group_name, FALSE
365 * otherwise.
366 * Since 2.6
368 public int hasKey(char[] groupName, char[] key, GError** error)
370 // gboolean g_key_file_has_key (GKeyFile *key_file, const gchar *group_name, const gchar *key, GError **error);
371 return g_key_file_has_key(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), error);
375 * Returns the value associated with key under group_name.
376 * In the event the key cannot be found, NULL is returned and
377 * error is set to G_KEY_FILE_ERROR_KEY_NOT_FOUND. In the
378 * event that the group_name cannot be found, NULL is returned
379 * and error is set to G_KEY_FILE_ERROR_GROUP_NOT_FOUND.
380 * key_file:
381 * a GKeyFile
382 * group_name:
383 * a group name
384 * key:
385 * a key
386 * error:
387 * return location for a GError, or NULL
388 * Returns:
389 * a newly allocated string or NULL if the specified
390 * key cannot be found.
391 * Since 2.6
393 public char[] getValue(char[] groupName, char[] key, GError** error)
395 // gchar* g_key_file_get_value (GKeyFile *key_file, const gchar *group_name, const gchar *key, GError **error);
396 return Str.toString(g_key_file_get_value(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), error) );
400 * Returns the value associated with key under group_name.
401 * In the event the key cannot be found, NULL is returned and
402 * error is set to G_KEY_FILE_ERROR_KEY_NOT_FOUND. In the
403 * event that the group_name cannot be found, NULL is returned
404 * and error is set to G_KEY_FILE_ERROR_GROUP_NOT_FOUND.
405 * key_file:
406 * a GKeyFile
407 * group_name:
408 * a group name
409 * key:
410 * a key
411 * error:
412 * return location for a GError, or NULL
413 * Returns:
414 * a newly allocated string or NULL if the specified
415 * key cannot be found.
416 * Since 2.6
418 public char[] getString(char[] groupName, char[] key, GError** error)
420 // gchar* g_key_file_get_string (GKeyFile *key_file, const gchar *group_name, const gchar *key, GError **error);
421 return Str.toString(g_key_file_get_string(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), error) );
425 * Returns the value associated with key under group_name
426 * translated in the given locale if available. If locale is
427 * NULL then the current locale is assumed.
428 * If key cannot be found then NULL is returned and error is set to
429 * G_KEY_FILE_ERROR_KEY_NOT_FOUND. If the value associated
430 * with key cannot be interpreted or no suitable translation can
431 * be found then the untranslated value is returned.
432 * key_file:
433 * a GKeyFile
434 * group_name:
435 * a group name
436 * key:
437 * a key
438 * locale:
439 * a locale or NULL
440 * error:
441 * return location for a GError, or NULL
442 * Returns:
443 * a newly allocated string or NULL if the specified
444 * key cannot be found.
445 * Since 2.6
447 public char[] getLocaleString(char[] groupName, char[] key, char[] locale, GError** error)
449 // gchar* g_key_file_get_locale_string (GKeyFile *key_file, const gchar *group_name, const gchar *key, const gchar *locale, GError **error);
450 return Str.toString(g_key_file_get_locale_string(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), Str.toStringz(locale), error) );
454 * Returns the value associated with key under group_name as a
455 * boolean.
456 * If key cannot be found then the return value is undefined and
457 * error is set to G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if
458 * the value associated with key cannot be interpreted as a boolean
459 * then the return value is also undefined and error is set to
460 * G_KEY_FILE_ERROR_INVALID_VALUE.
461 * key_file:
462 * a GKeyFile
463 * group_name:
464 * a group name
465 * key:
466 * a key
467 * error:
468 * return location for a GError
469 * Returns:
470 * the value associated with the key as a boolean
471 * Since 2.6
473 public int getBoolean(char[] groupName, char[] key, GError** error)
475 // gboolean g_key_file_get_boolean (GKeyFile *key_file, const gchar *group_name, const gchar *key, GError **error);
476 return g_key_file_get_boolean(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), error);
480 * Returns the value associated with key under group_name as an
481 * integer. If group_name is NULL, the start_group is used.
482 * If key cannot be found then the return value is undefined and
483 * error is set to G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if
484 * the value associated with key cannot be interpreted as an integer
485 * then the return value is also undefined and error is set to
486 * G_KEY_FILE_ERROR_INVALID_VALUE.
487 * key_file:
488 * a GKeyFile
489 * group_name:
490 * a group name
491 * key:
492 * a key
493 * error:
494 * return location for a GError
495 * Returns:
496 * the value associated with the key as an integer.
497 * Since 2.6
499 public int getInteger(char[] groupName, char[] key, GError** error)
501 // gint g_key_file_get_integer (GKeyFile *key_file, const gchar *group_name, const gchar *key, GError **error);
502 return g_key_file_get_integer(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), error);
506 * Returns the value associated with key under group_name as an
507 * integer. If group_name is NULL, the start_group is used.
508 * If key cannot be found then the return value is undefined and
509 * error is set to G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if
510 * the value associated with key cannot be interpreted as a double
511 * then the return value is also undefined and error is set to
512 * G_KEY_FILE_ERROR_INVALID_VALUE.
513 * key_file:
514 * a GKeyFile
515 * group_name:
516 * a group name
517 * key:
518 * a key
519 * error:
520 * return location for a GError
521 * Returns:
522 * the value associated with the key as a double.
523 * Since 2.12
525 public double getDouble(char[] groupName, char[] key, GError** error)
527 // gdouble g_key_file_get_double (GKeyFile *key_file, const gchar *group_name, const gchar *key, GError **error);
528 return g_key_file_get_double(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), error);
532 * Returns the values associated with key under group_name.
533 * In the event the key cannot be found, NULL is returned and
534 * error is set to G_KEY_FILE_ERROR_KEY_NOT_FOUND. In the
535 * event that the group_name cannot be found, NULL is returned
536 * and error is set to G_KEY_FILE_ERROR_GROUP_NOT_FOUND.
537 * key_file:
538 * a GKeyFile
539 * group_name:
540 * a group name
541 * key:
542 * a key
543 * length:
544 * return location for the number of returned strings, or NULL
545 * error:
546 * return location for a GError, or NULL
547 * Returns:
548 * a NULL-terminated string array or NULL if the specified
549 * key cannot be found. The array should be freed with g_strfreev().
550 * Since 2.6
552 public char** getStringList(char[] groupName, char[] key, uint* length, GError** error)
554 // gchar** g_key_file_get_string_list (GKeyFile *key_file, const gchar *group_name, const gchar *key, gsize *length, GError **error);
555 return g_key_file_get_string_list(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), length, error);
559 * Returns the values associated with key under group_name
560 * translated in the given locale if available. If locale is
561 * NULL then the current locale is assumed.
562 * If key cannot be found then NULL is returned and error is set to
563 * G_KEY_FILE_ERROR_KEY_NOT_FOUND. If the values associated
564 * with key cannot be interpreted or no suitable translations
565 * can be found then the untranslated values are returned.
566 * The returned array is NULL-terminated, so length may optionally be NULL.
567 * key_file:
568 * a GKeyFile
569 * group_name:
570 * a group name
571 * key:
572 * a key
573 * locale:
574 * a locale
575 * length:
576 * return location for the number of returned strings or NULL
577 * error:
578 * return location for a GError or NULL
579 * Returns:
580 * a newly allocated NULL-terminated string array
581 * or NULL if the key isn't found. The string array should be freed
582 * with g_strfreev().
583 * Since 2.6
585 public char** getLocaleStringList(char[] groupName, char[] key, char[] locale, uint* length, GError** error)
587 // gchar** g_key_file_get_locale_string_list (GKeyFile *key_file, const gchar *group_name, const gchar *key, const gchar *locale, gsize *length, GError **error);
588 return g_key_file_get_locale_string_list(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), Str.toStringz(locale), length, error);
592 * Returns the values associated with key under group_name as
593 * booleans. If group_name is NULL, the start_group is used.
594 * If key cannot be found then the return value is undefined and
595 * error is set to G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if
596 * the values associated with key cannot be interpreted as booleans
597 * then the return value is also undefined and error is set to
598 * G_KEY_FILE_ERROR_INVALID_VALUE.
599 * key_file:
600 * a GKeyFile
601 * group_name:
602 * a group name
603 * key:
604 * a key
605 * length:
606 * the number of booleans returned
607 * error:
608 * return location for a GError
609 * Returns:
610 * the values associated with the key as a boolean
611 * Since 2.6
613 public int* getBooleanList(char[] groupName, char[] key, uint* length, GError** error)
615 // gboolean* g_key_file_get_boolean_list (GKeyFile *key_file, const gchar *group_name, const gchar *key, gsize *length, GError **error);
616 return g_key_file_get_boolean_list(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), length, error);
620 * Returns the values associated with key under group_name as
621 * integers.
622 * If key cannot be found then the return value is undefined and
623 * error is set to G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if
624 * the values associated with key cannot be interpreted as integers
625 * then the return value is also undefined and error is set to
626 * G_KEY_FILE_ERROR_INVALID_VALUE.
627 * key_file:
628 * a GKeyFile
629 * group_name:
630 * a group name
631 * key:
632 * a key
633 * length:
634 * the number of integers returned
635 * error:
636 * return location for a GError
637 * Returns:
638 * the values associated with the key as a integer
639 * Since 2.6
641 public int* getIntegerList(char[] groupName, char[] key, uint* length, GError** error)
643 // gint* g_key_file_get_integer_list (GKeyFile *key_file, const gchar *group_name, const gchar *key, gsize *length, GError **error);
644 return g_key_file_get_integer_list(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), length, error);
648 * Returns the values associated with key under group_name as
649 * doubles. If group_name is NULL, the start group is used.
650 * If key cannot be found then the return value is undefined and
651 * error is set to G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if
652 * the values associated with key cannot be interpreted as doubles
653 * then the return value is also undefined and error is set to
654 * G_KEY_FILE_ERROR_INVALID_VALUE.
655 * key_file:
656 * a GKeyFile
657 * group_name:
658 * a group name
659 * key:
660 * a key
661 * length:
662 * the number of doubles returned
663 * error:
664 * return location for a GError
665 * Returns:
666 * the values associated with the key as a double
667 * Since 2.12
669 public double* getDoubleList(char[] groupName, char[] key, uint* length, GError** error)
671 // gdouble* g_key_file_get_double_list (GKeyFile *key_file, const gchar *group_name, const gchar *key, gsize *length, GError **error);
672 return g_key_file_get_double_list(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), length, error);
676 * Retrieves a comment above key from group_name.
677 * group_name. If key is NULL then comment will
678 * be read from above group_name. If both key
679 * and group_name are NULL, then comment will
680 * be read from above the first group in the file.
681 * key_file:
682 * a GKeyFile
683 * group_name:
684 * a group name, or NULL
685 * key:
686 * a key
687 * error:
688 * return location for a GError
689 * Returns:
690 * a comment that should be freed with g_free()
691 * Since 2.6
693 public char[] getComment(char[] groupName, char[] key, GError** error)
695 // gchar* g_key_file_get_comment (GKeyFile *key_file, const gchar *group_name, const gchar *key, GError **error);
696 return Str.toString(g_key_file_get_comment(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), error) );
700 * Associates a new value with key under group_name. If key
701 * cannot be found then it is created. If group_name cannot be
702 * found then it is created.
703 * key_file:
704 * a GKeyFile
705 * group_name:
706 * a group name
707 * key:
708 * a key
709 * value:
710 * a string
711 * Since 2.6
713 public void setValue(char[] groupName, char[] key, char[] value)
715 // void g_key_file_set_value (GKeyFile *key_file, const gchar *group_name, const gchar *key, const gchar *value);
716 g_key_file_set_value(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), Str.toStringz(value));
720 * Associates a new string value with key under group_name. If
721 * key cannot be found then it is created. If group_name
722 * cannot be found then it is created.
723 * key_file:
724 * a GKeyFile
725 * group_name:
726 * a group name
727 * key:
728 * a key
729 * string:
730 * a string
731 * Since 2.6
733 public void setString(char[] groupName, char[] key, char[] string)
735 // void g_key_file_set_string (GKeyFile *key_file, const gchar *group_name, const gchar *key, const gchar *string);
736 g_key_file_set_string(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), Str.toStringz(string));
740 * Associates a string value for key and locale under
741 * group_name. If the translation for key cannot be found
742 * then it is created.
743 * key_file:
744 * a GKeyFile
745 * group_name:
746 * a group name
747 * key:
748 * a key
749 * locale:
750 * a locale
751 * string:
752 * a string
753 * Since 2.6
755 public void setLocaleString(char[] groupName, char[] key, char[] locale, char[] string)
757 // void g_key_file_set_locale_string (GKeyFile *key_file, const gchar *group_name, const gchar *key, const gchar *locale, const gchar *string);
758 g_key_file_set_locale_string(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), Str.toStringz(locale), Str.toStringz(string));
762 * Associates a new boolean value with key under group_name.
763 * If key cannot be found then it is created.
764 * key_file:
765 * a GKeyFile
766 * group_name:
767 * a group name
768 * key:
769 * a key
770 * value:
771 * TRUE or FALSE
772 * Since 2.6
774 public void setBoolean(char[] groupName, char[] key, int value)
776 // void g_key_file_set_boolean (GKeyFile *key_file, const gchar *group_name, const gchar *key, gboolean value);
777 g_key_file_set_boolean(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), value);
781 * Associates a new integer value with key under group_name.
782 * If key cannot be found then it is created.
783 * key_file:
784 * a GKeyFile
785 * group_name:
786 * a group name
787 * key:
788 * a key
789 * value:
790 * an integer value
791 * Since 2.6
793 public void setInteger(char[] groupName, char[] key, int value)
795 // void g_key_file_set_integer (GKeyFile *key_file, const gchar *group_name, const gchar *key, gint value);
796 g_key_file_set_integer(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), value);
800 * Associates a new double value with key under group_name.
801 * If key cannot be found then it is created. If group_name
802 * is NULL, the start group is used.
803 * key_file:
804 * a GKeyFile
805 * group_name:
806 * a group name
807 * key:
808 * a key
809 * value:
810 * an double value
811 * Since 2.12
813 public void setDouble(char[] groupName, char[] key, double value)
815 // void g_key_file_set_double (GKeyFile *key_file, const gchar *group_name, const gchar *key, gdouble value);
816 g_key_file_set_double(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), value);
820 * Associates a list of string values for key under group_name.
821 * If key cannot be found then it is created. If group_name
822 * cannot be found then it is created.
823 * key_file:
824 * a GKeyFile
825 * group_name:
826 * a group name
827 * key:
828 * a key
829 * Since 2.6
831 public void setStringList(char[] groupName, char[] key)
833 // void g_key_file_set_string_list (GKeyFile *key_file, const gchar *group_name, const gchar *key);
834 g_key_file_set_string_list(gKeyFile, Str.toStringz(groupName), Str.toStringz(key));
838 * Associates a list of string values for key and locale under
839 * group_name. If the translation for key cannot be found then
840 * it is created.
841 * key_file:
842 * a GKeyFile
843 * group_name:
844 * a group name
845 * key:
846 * a key
847 * locale:
848 * a locale
849 * Since 2.6
851 public void setLocaleStringList(char[] groupName, char[] key, char[] locale)
853 // void g_key_file_set_locale_string_list (GKeyFile *key_file, const gchar *group_name, const gchar *key, const gchar *locale);
854 g_key_file_set_locale_string_list(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), Str.toStringz(locale));
858 * Associates a list of boolean values with key under
859 * group_name. If key cannot be found then it is created.
860 * If group_name is NULL, the start_group is used.
861 * key_file:
862 * a GKeyFile
863 * group_name:
864 * a group name
865 * key:
866 * a key
867 * list:
868 * an array of boolean values
869 * length:
870 * length of list
871 * Since 2.6
873 public void setBooleanList(char[] groupName, char[] key, int[] list, uint length)
875 // void g_key_file_set_boolean_list (GKeyFile *key_file, const gchar *group_name, const gchar *key, gboolean list[], gsize length);
876 g_key_file_set_boolean_list(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), list, length);
880 * Associates a list of integer values with key under
881 * group_name. If key cannot be found then it is created.
882 * key_file:
883 * a GKeyFile
884 * group_name:
885 * a group name
886 * key:
887 * a key
888 * list:
889 * an array of integer values
890 * length:
891 * number of integer values in list
892 * Since 2.6
894 public void setIntegerList(char[] groupName, char[] key, int[] list, uint length)
896 // void g_key_file_set_integer_list (GKeyFile *key_file, const gchar *group_name, const gchar *key, gint list[], gsize length);
897 g_key_file_set_integer_list(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), list, length);
901 * Associates a list of double values with key under
902 * group_name. If key cannot be found then it is created.
903 * If group_name is NULL the start group is used.
904 * key_file:
905 * a GKeyFile
906 * group_name:
907 * a group name
908 * key:
909 * a key
910 * list:
911 * an array of double values
912 * length:
913 * number of double values in list
914 * Since 2.12
916 public void setDoubleList(char[] groupName, char[] key, double[] list, uint length)
918 // void g_key_file_set_double_list (GKeyFile *key_file, const gchar *group_name, const gchar *key, gdouble list[], gsize length);
919 g_key_file_set_double_list(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), list, length);
923 * Places a comment above key from group_name.
924 * group_name. If key is NULL then comment will
925 * be written above group_name. If both key
926 * and group_name are NULL, then comment will
927 * be written above the first group in the file.
928 * key_file:
929 * a GKeyFile
930 * group_name:
931 * a group name, or NULL
932 * key:
933 * a key
934 * comment:
935 * a comment
936 * error:
937 * return location for a GError
938 * Since 2.6
940 public void setComment(char[] groupName, char[] key, char[] comment, GError** error)
942 // void g_key_file_set_comment (GKeyFile *key_file, const gchar *group_name, const gchar *key, const gchar *comment, GError **error);
943 g_key_file_set_comment(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), Str.toStringz(comment), error);
947 * Removes the specified group, group_name,
948 * from the key file.
949 * key_file:
950 * a GKeyFile
951 * group_name:
952 * a group name
953 * error:
954 * return location for a GError or NULL
955 * Since 2.6
957 public void removeGroup(char[] groupName, GError** error)
959 // void g_key_file_remove_group (GKeyFile *key_file, const gchar *group_name, GError **error);
960 g_key_file_remove_group(gKeyFile, Str.toStringz(groupName), error);
964 * Removes key in group_name from the key file.
965 * key_file:
966 * a GKeyFile
967 * group_name:
968 * a group name
969 * key:
970 * a key name to remove
971 * error:
972 * return location for a GError or NULL
973 * Since 2.6
975 public void removeKey(char[] groupName, char[] key, GError** error)
977 // void g_key_file_remove_key (GKeyFile *key_file, const gchar *group_name, const gchar *key, GError **error);
978 g_key_file_remove_key(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), error);
982 * Removes a comment above key from group_name.
983 * group_name. If key is NULL then comment will
984 * be written above group_name. If both key
985 * and group_name are NULL, then comment will
986 * be written above the first group in the file.
987 * key_file:
988 * a GKeyFile
989 * group_name:
990 * a group name, or NULL
991 * key:
992 * a key
993 * error:
994 * return location for a GError
995 * Since 2.6
997 public void removeComment(char[] groupName, char[] key, GError** error)
999 // void g_key_file_remove_comment (GKeyFile *key_file, const gchar *group_name, const gchar *key, GError **error);
1000 g_key_file_remove_comment(gKeyFile, Str.toStringz(groupName), Str.toStringz(key), error);