1 /* 2 * Distributed under the Boost Software License, Version 1.0. 3 * (See accompanying file LICENSE_1_0.txt or copy at 4 * http://www.boost.org/LICENSE_1_0.txt) 5 */ 6 module glib.gkeyfile; 7 8 import glib.gtypes; 9 import glib.gerror; 10 11 12 enum GKeyFileError 13 { 14 G_KEY_FILE_ERROR_UNKNOWN_ENCODING, 15 G_KEY_FILE_ERROR_PARSE, 16 G_KEY_FILE_ERROR_NOT_FOUND, 17 G_KEY_FILE_ERROR_KEY_NOT_FOUND, 18 G_KEY_FILE_ERROR_GROUP_NOT_FOUND, 19 G_KEY_FILE_ERROR_INVALID_VALUE 20 } 21 22 //enum G_KEY_FILE_ERROR = g_key_file_error_quark(); 23 24 25 26 struct GKeyFile; 27 28 enum GKeyFileFlags 29 { 30 G_KEY_FILE_NONE = 0, 31 G_KEY_FILE_KEEP_COMMENTS = 1 << 0, 32 G_KEY_FILE_KEEP_TRANSLATIONS = 1 << 1 33 } 34 35 36 extern (C) { 37 38 GQuark g_key_file_error_quark (); 39 40 GKeyFile *g_key_file_new (); 41 42 GKeyFile *g_key_file_ref (GKeyFile *key_file); 43 44 void g_key_file_unref (GKeyFile *key_file); 45 46 void g_key_file_free (GKeyFile *key_file); 47 48 void g_key_file_set_list_separator (GKeyFile *key_file, 49 gchar separator); 50 51 gboolean g_key_file_load_from_file (GKeyFile *key_file, 52 const(gchar) *file, 53 GKeyFileFlags flags, 54 GError **error); 55 56 gboolean g_key_file_load_from_data (GKeyFile *key_file, 57 const(gchar) *data, 58 gsize length, 59 GKeyFileFlags flags, 60 GError **error); 61 62 gboolean g_key_file_load_from_dirs (GKeyFile *key_file, 63 const(gchar) *file, 64 const(gchar) **search_dirs, 65 gchar **full_path, 66 GKeyFileFlags flags, 67 GError **error); 68 69 gboolean g_key_file_load_from_data_dirs (GKeyFile *key_file, 70 const(gchar) *file, 71 gchar **full_path, 72 GKeyFileFlags flags, 73 GError **error); 74 75 gchar *g_key_file_to_data (GKeyFile *key_file, 76 gsize *length, 77 GError **error); 78 79 gboolean g_key_file_save_to_file (GKeyFile *key_file, 80 const(gchar) *filename, 81 GError **error); 82 83 gchar *g_key_file_get_start_group (GKeyFile *key_file); 84 85 gchar **g_key_file_get_groups (GKeyFile *key_file, 86 gsize *length); 87 88 gchar **g_key_file_get_keys (GKeyFile *key_file, 89 const(gchar) *group_name, 90 gsize *length, 91 GError **error); 92 93 gboolean g_key_file_has_group (GKeyFile *key_file, 94 const(gchar) *group_name); 95 96 gboolean g_key_file_has_key (GKeyFile *key_file, 97 const(gchar) *group_name, 98 const(gchar) *key, 99 GError **error); 100 101 gchar *g_key_file_get_value (GKeyFile *key_file, 102 const(gchar) *group_name, 103 const(gchar) *key, 104 GError **error); 105 106 void g_key_file_set_value (GKeyFile *key_file, 107 const(gchar) *group_name, 108 const(gchar) *key, 109 const(gchar) *value); 110 111 gchar *g_key_file_get_string (GKeyFile *key_file, 112 const(gchar) *group_name, 113 const(gchar) *key, 114 GError **error); 115 116 void g_key_file_set_string (GKeyFile *key_file, 117 const(gchar) *group_name, 118 const(gchar) *key, 119 const(gchar) *str); 120 121 gchar *g_key_file_get_locale_string (GKeyFile *key_file, 122 const(gchar) *group_name, 123 const(gchar) *key, 124 const(gchar) *locale, 125 GError **error); 126 127 void g_key_file_set_locale_string (GKeyFile *key_file, 128 const(gchar) *group_name, 129 const(gchar) *key, 130 const(gchar) *locale, 131 const(gchar) *str); 132 133 gboolean g_key_file_get_boolean (GKeyFile *key_file, 134 const(gchar) *group_name, 135 const(gchar) *key, 136 GError **error); 137 138 void g_key_file_set_boolean (GKeyFile *key_file, 139 const(gchar) *group_name, 140 const(gchar) *key, 141 gboolean value); 142 143 gint g_key_file_get_integer (GKeyFile *key_file, 144 const(gchar) *group_name, 145 const(gchar) *key, 146 GError **error); 147 148 void g_key_file_set_integer (GKeyFile *key_file, 149 const(gchar) *group_name, 150 const(gchar) *key, 151 gint value); 152 153 gint64 g_key_file_get_int64 (GKeyFile *key_file, 154 const(gchar) *group_name, 155 const(gchar) *key, 156 GError **error); 157 158 void g_key_file_set_int64 (GKeyFile *key_file, 159 const(gchar) *group_name, 160 const(gchar) *key, 161 gint64 value); 162 163 guint64 g_key_file_get_uint64 (GKeyFile *key_file, 164 const(gchar) *group_name, 165 const(gchar) *key, 166 GError **error); 167 168 void g_key_file_set_uint64 (GKeyFile *key_file, 169 const(gchar) *group_name, 170 const(gchar) *key, 171 guint64 value); 172 173 gdouble g_key_file_get_double (GKeyFile *key_file, 174 const(gchar) *group_name, 175 const(gchar) *key, 176 GError **error); 177 178 void g_key_file_set_double (GKeyFile *key_file, 179 const(gchar) *group_name, 180 const(gchar) *key, 181 gdouble value); 182 183 gchar **g_key_file_get_string_list (GKeyFile *key_file, 184 const(gchar) *group_name, 185 const(gchar) *key, 186 gsize *length, 187 GError **error); 188 189 void g_key_file_set_string_list (GKeyFile *key_file, 190 const(gchar) *group_name, 191 const(gchar) *key, 192 const(gchar*)* list, 193 gsize length); 194 195 gchar **g_key_file_get_locale_string_list (GKeyFile *key_file, 196 const(gchar) *group_name, 197 const(gchar) *key, 198 const(gchar) *locale, 199 gsize *length, 200 GError **error); 201 202 void g_key_file_set_locale_string_list (GKeyFile *key_file, 203 const(gchar) *group_name, 204 const(gchar) *key, 205 const(gchar) *locale, 206 const(gchar*)* list, 207 gsize length); 208 209 gboolean *g_key_file_get_boolean_list (GKeyFile *key_file, 210 const(gchar) *group_name, 211 const(gchar) *key, 212 gsize *length, 213 GError **error); 214 215 void g_key_file_set_boolean_list (GKeyFile *key_file, 216 const(gchar) *group_name, 217 const(gchar) *key, 218 gboolean* list, 219 gsize length); 220 221 gint *g_key_file_get_integer_list (GKeyFile *key_file, 222 const(gchar) *group_name, 223 const(gchar) *key, 224 gsize *length, 225 GError **error); 226 227 void g_key_file_set_double_list (GKeyFile *key_file, 228 const(gchar) *group_name, 229 const(gchar) *key, 230 gdouble* list, 231 gsize length); 232 233 gdouble *g_key_file_get_double_list (GKeyFile *key_file, 234 const(gchar) *group_name, 235 const(gchar) *key, 236 gsize *length, 237 GError **error); 238 239 void g_key_file_set_integer_list (GKeyFile *key_file, 240 const(gchar) *group_name, 241 const(gchar) *key, 242 gint* list, 243 gsize length); 244 245 gboolean g_key_file_set_comment (GKeyFile *key_file, 246 const(gchar) *group_name, 247 const(gchar) *key, 248 const(gchar) *comment, 249 GError **error); 250 251 gchar *g_key_file_get_comment (GKeyFile *key_file, 252 const(gchar) *group_name, 253 const(gchar) *key, 254 GError **error); 255 256 257 gboolean g_key_file_remove_comment (GKeyFile *key_file, 258 const(gchar) *group_name, 259 const(gchar) *key, 260 GError **error); 261 262 gboolean g_key_file_remove_key (GKeyFile *key_file, 263 const(gchar) *group_name, 264 const(gchar) *key, 265 GError **error); 266 267 gboolean g_key_file_remove_group (GKeyFile *key_file, 268 const(gchar) *group_name, 269 GError **error); 270 271 } 272 273 enum G_KEY_FILE_DESKTOP_GROUP = "Desktop Entry"; 274 275 enum G_KEY_FILE_DESKTOP_KEY_TYPE = "Type"; 276 enum G_KEY_FILE_DESKTOP_KEY_VERSION = "Version"; 277 enum G_KEY_FILE_DESKTOP_KEY_NAME = "Name"; 278 enum G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME = "GenericName"; 279 enum G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY = "NoDisplay"; 280 enum G_KEY_FILE_DESKTOP_KEY_COMMENT = "Comment"; 281 enum G_KEY_FILE_DESKTOP_KEY_ICON = "Icon"; 282 enum G_KEY_FILE_DESKTOP_KEY_HIDDEN = "Hidden"; 283 enum G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN = "OnlyShowIn"; 284 enum G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN = "NotShowIn"; 285 enum G_KEY_FILE_DESKTOP_KEY_TRY_EXEC = "TryExec"; 286 enum G_KEY_FILE_DESKTOP_KEY_EXEC = "Exec"; 287 enum G_KEY_FILE_DESKTOP_KEY_PATH = "Path"; 288 enum G_KEY_FILE_DESKTOP_KEY_TERMINAL = "Terminal"; 289 enum G_KEY_FILE_DESKTOP_KEY_MIME_TYPE = "MimeType"; 290 enum G_KEY_FILE_DESKTOP_KEY_CATEGORIES = "Categories"; 291 enum G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY = "StartupNotify"; 292 enum G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS = "StartupWMClass"; 293 enum G_KEY_FILE_DESKTOP_KEY_URL = "URL"; 294 enum G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE = "DBusActivatable"; 295 enum G_KEY_FILE_DESKTOP_KEY_ACTIONS = "Actions"; 296 297 enum G_KEY_FILE_DESKTOP_TYPE_APPLICATION = "Application"; 298 enum G_KEY_FILE_DESKTOP_TYPE_LINK = "Link"; 299 enum G_KEY_FILE_DESKTOP_TYPE_DIRECTORY = "Directory"; 300