build: Enable -fno-strict-aliasing
[glib.git] / gio / gfile.h
blob1717665e4f874cbdda1e2c9a9f0fa8195f96483f
1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2006-2007 Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
18 * Author: Alexander Larsson <alexl@redhat.com>
21 #ifndef __G_FILE_H__
22 #define __G_FILE_H__
24 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
25 #error "Only <gio/gio.h> can be included directly."
26 #endif
28 #include <gio/giotypes.h>
30 G_BEGIN_DECLS
32 #define G_TYPE_FILE (g_file_get_type ())
33 #define G_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_FILE, GFile))
34 #define G_IS_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_FILE))
35 #define G_FILE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_FILE, GFileIface))
37 #if 0
38 /**
39 * GFile:
41 * A handle to an object implementing the #GFileIface interface.
42 * Generally stores a location within the file system. Handles do not
43 * necessarily represent files or directories that currently exist.
44 **/
45 typedef struct _GFile GFile; /* Dummy typedef */
46 #endif
47 typedef struct _GFileIface GFileIface;
50 /**
51 * GFileIface:
52 * @g_iface: The parent interface.
53 * @dup: Duplicates a #GFile.
54 * @hash: Creates a hash of a #GFile.
55 * @equal: Checks equality of two given #GFiles.
56 * @is_native: Checks to see if a file is native to the system.
57 * @has_uri_scheme: Checks to see if a #GFile has a given URI scheme.
58 * @get_uri_scheme: Gets the URI scheme for a #GFile.
59 * @get_basename: Gets the basename for a given #GFile.
60 * @get_path: Gets the current path within a #GFile.
61 * @get_uri: Gets a URI for the path within a #GFile.
62 * @get_parse_name: Gets the parsed name for the #GFile.
63 * @get_parent: Gets the parent directory for the #GFile.
64 * @prefix_matches: Checks whether a #GFile contains a specified file.
65 * @get_relative_path: Gets the path for a #GFile relative to a given path.
66 * @resolve_relative_path: Resolves a relative path for a #GFile to an absolute path.
67 * @get_child_for_display_name: Gets the child #GFile for a given display name.
68 * @enumerate_children: Gets a #GFileEnumerator with the children of a #GFile.
69 * @enumerate_children_async: Asynchronously gets a #GFileEnumerator with the children of a #GFile.
70 * @enumerate_children_finish: Finishes asynchronously enumerating the children.
71 * @query_info: Gets the #GFileInfo for a #GFile.
72 * @query_info_async: Asynchronously gets the #GFileInfo for a #GFile.
73 * @query_info_finish: Finishes an asynchronous query info operation.
74 * @query_filesystem_info: Gets a #GFileInfo for the file system #GFile is on.
75 * @query_filesystem_info_async: Asynchronously gets a #GFileInfo for the file system #GFile is on.
76 * @query_filesystem_info_finish: Finishes asynchronously getting the file system info.
77 * @find_enclosing_mount: Gets a #GMount for the #GFile.
78 * @find_enclosing_mount_async: Asynchronously gets the #GMount for a #GFile.
79 * @find_enclosing_mount_finish: Finishes asynchronously getting the volume.
80 * @set_display_name: Sets the display name for a #GFile.
81 * @set_display_name_async: Asynchronously sets a #GFile's display name.
82 * @set_display_name_finish: Finishes asynchronously setting a #GFile's display name.
83 * @query_settable_attributes: Returns a list of #GFileAttributes that can be set.
84 * @_query_settable_attributes_async: Asynchronously gets a list of #GFileAttributes that can be set.
85 * @_query_settable_attributes_finish: Finishes asynchronously querying settable attributes.
86 * @query_writable_namespaces: Returns a list of #GFileAttribute namespaces that are writable.
87 * @_query_writable_namespaces_async: Asynchronously gets a list of #GFileAttribute namespaces that are writable.
88 * @_query_writable_namespaces_finish: Finishes asynchronously querying the writable namespaces.
89 * @set_attribute: Sets a #GFileAttribute.
90 * @set_attributes_from_info: Sets a #GFileAttribute with information from a #GFileInfo.
91 * @set_attributes_async: Asynchronously sets a file's attributes.
92 * @set_attributes_finish: Finishes setting a file's attributes asynchronously.
93 * @read_fn: Reads a file asynchronously.
94 * @read_async: Asynchronously reads a file.
95 * @read_finish: Finishes asynchronously reading a file.
96 * @append_to: Writes to the end of a file.
97 * @append_to_async: Asynchronously writes to the end of a file.
98 * @append_to_finish: Finishes an asynchronous file append operation.
99 * @create: Creates a new file.
100 * @create_async: Asynchronously creates a file.
101 * @create_finish: Finishes asynchronously creating a file.
102 * @replace: Replaces the contents of a file.
103 * @replace_async: Asynchronously replaces the contents of a file.
104 * @replace_finish: Finishes asynchronously replacing a file.
105 * @delete_file: Deletes a file.
106 * @delete_file_async: Asynchronously deletes a file.
107 * @delete_file_finish: Finishes an asynchronous delete.
108 * @trash: Sends a #GFile to the Trash location.
109 * @trash_async: Asynchronously sends a #GFile to the Trash location.
110 * @trash_finish: Finishes an asynchronous file trashing operation.
111 * @make_directory: Makes a directory.
112 * @make_directory_async: Asynchronously makes a directory.
113 * @make_directory_finish: Finishes making a directory asynchronously.
114 * @make_symbolic_link: Makes a symbolic link.
115 * @_make_symbolic_link_async: Asynchronously makes a symbolic link
116 * @_make_symbolic_link_finish: Finishes making a symbolic link asynchronously.
117 * @copy: Copies a file.
118 * @copy_async: Asynchronously copies a file.
119 * @copy_finish: Finishes an asynchronous copy operation.
120 * @move: Moves a file.
121 * @_move_async: Asynchronously moves a file.
122 * @_move_finish: Finishes an asynchronous move operation.
123 * @mount_mountable: Mounts a mountable object.
124 * @mount_mountable_finish: Finishes a mounting operation.
125 * @unmount_mountable: Unmounts a mountable object.
126 * @unmount_mountable_finish: Finishes an unmount operation.
127 * @eject_mountable: Ejects a mountable.
128 * @eject_mountable_finish: Finishes an eject operation.
129 * @mount_enclosing_volume: Mounts a specified location.
130 * @mount_enclosing_volume_finish: Finishes mounting a specified location.
131 * @monitor_dir: Creates a #GFileMonitor for the location.
132 * @monitor_file: Creates a #GFileMonitor for the location.
133 * @open_readwrite: Open file read/write. Since 2.22.
134 * @open_readwrite_async: Asynchronously opens file read/write. Since 2.22.
135 * @open_readwrite_finish: Finishes an asynchronous open read/write. Since 2.22.
136 * @create_readwrite: Creates file read/write. Since 2.22.
137 * @create_readwrite_async: Asynchronously creates file read/write. Since 2.22.
138 * @create_readwrite_finish: Finishes an asynchronous creates read/write. Since 2.22.
139 * @replace_readwrite: Replaces file read/write. Since 2.22.
140 * @replace_readwrite_async: Asynchronously replaces file read/write. Since 2.22.
141 * @replace_readwrite_finish: Finishes an asynchronous replace read/write. Since 2.22.
142 * @start_mountable: Starts a mountable object. Since 2.22.
143 * @start_mountable_finish: Finishes an start operation. Since 2.22.
144 * @stop_mountable: Stops a mountable. Since 2.22.
145 * @stop_mountable_finish: Finishes an stop operation. Since 2.22.
146 * @supports_thread_contexts: a boolean that indicates whether the #GFile implementation supports thread-default contexts. Since 2.22.
147 * @unmount_mountable_with_operation: Unmounts a mountable object using a #GMountOperation. Since 2.22.
148 * @unmount_mountable_with_operation_finish: Finishes an unmount operation using a #GMountOperation. Since 2.22.
149 * @eject_mountable_with_operation: Ejects a mountable object using a #GMountOperation. Since 2.22.
150 * @eject_mountable_with_operation_finish: Finishes an eject operation using a #GMountOperation. Since 2.22.
151 * @poll_mountable: Polls a mountable object for media changes. Since 2.22.
152 * @poll_mountable_finish: Finishes an poll operation for media changes. Since 2.22.
153 * @measure_disk_usage: Recursively measures the disk usage of @file. Since 2.38
154 * @measure_disk_usage_async: Asynchronously recursively measures the disk usage of @file. Since 2.38
155 * @measure_disk_usage_finish: Finishes an asynchronous recursive measurement of the disk usage of @file. Since 2.38
157 * An interface for writing VFS file handles.
159 struct _GFileIface
161 GTypeInterface g_iface;
163 /* Virtual Table */
165 GFile * (* dup) (GFile *file);
166 guint (* hash) (GFile *file);
167 gboolean (* equal) (GFile *file1,
168 GFile *file2);
169 gboolean (* is_native) (GFile *file);
170 gboolean (* has_uri_scheme) (GFile *file,
171 const char *uri_scheme);
172 char * (* get_uri_scheme) (GFile *file);
173 char * (* get_basename) (GFile *file);
174 char * (* get_path) (GFile *file);
175 char * (* get_uri) (GFile *file);
176 char * (* get_parse_name) (GFile *file);
177 GFile * (* get_parent) (GFile *file);
178 gboolean (* prefix_matches) (GFile *prefix,
179 GFile *file);
180 char * (* get_relative_path) (GFile *parent,
181 GFile *descendant);
182 GFile * (* resolve_relative_path) (GFile *file,
183 const char *relative_path);
184 GFile * (* get_child_for_display_name) (GFile *file,
185 const char *display_name,
186 GError **error);
188 GFileEnumerator * (* enumerate_children) (GFile *file,
189 const char *attributes,
190 GFileQueryInfoFlags flags,
191 GCancellable *cancellable,
192 GError **error);
193 void (* enumerate_children_async) (GFile *file,
194 const char *attributes,
195 GFileQueryInfoFlags flags,
196 int io_priority,
197 GCancellable *cancellable,
198 GAsyncReadyCallback callback,
199 gpointer user_data);
200 GFileEnumerator * (* enumerate_children_finish) (GFile *file,
201 GAsyncResult *res,
202 GError **error);
204 GFileInfo * (* query_info) (GFile *file,
205 const char *attributes,
206 GFileQueryInfoFlags flags,
207 GCancellable *cancellable,
208 GError **error);
209 void (* query_info_async) (GFile *file,
210 const char *attributes,
211 GFileQueryInfoFlags flags,
212 int io_priority,
213 GCancellable *cancellable,
214 GAsyncReadyCallback callback,
215 gpointer user_data);
216 GFileInfo * (* query_info_finish) (GFile *file,
217 GAsyncResult *res,
218 GError **error);
220 GFileInfo * (* query_filesystem_info) (GFile *file,
221 const char *attributes,
222 GCancellable *cancellable,
223 GError **error);
224 void (* query_filesystem_info_async) (GFile *file,
225 const char *attributes,
226 int io_priority,
227 GCancellable *cancellable,
228 GAsyncReadyCallback callback,
229 gpointer user_data);
230 GFileInfo * (* query_filesystem_info_finish)(GFile *file,
231 GAsyncResult *res,
232 GError **error);
234 GMount * (* find_enclosing_mount) (GFile *file,
235 GCancellable *cancellable,
236 GError **error);
237 void (* find_enclosing_mount_async) (GFile *file,
238 int io_priority,
239 GCancellable *cancellable,
240 GAsyncReadyCallback callback,
241 gpointer user_data);
242 GMount * (* find_enclosing_mount_finish) (GFile *file,
243 GAsyncResult *res,
244 GError **error);
246 GFile * (* set_display_name) (GFile *file,
247 const char *display_name,
248 GCancellable *cancellable,
249 GError **error);
250 void (* set_display_name_async) (GFile *file,
251 const char *display_name,
252 int io_priority,
253 GCancellable *cancellable,
254 GAsyncReadyCallback callback,
255 gpointer user_data);
256 GFile * (* set_display_name_finish) (GFile *file,
257 GAsyncResult *res,
258 GError **error);
260 GFileAttributeInfoList * (* query_settable_attributes) (GFile *file,
261 GCancellable *cancellable,
262 GError **error);
263 void (* _query_settable_attributes_async) (void);
264 void (* _query_settable_attributes_finish) (void);
266 GFileAttributeInfoList * (* query_writable_namespaces) (GFile *file,
267 GCancellable *cancellable,
268 GError **error);
269 void (* _query_writable_namespaces_async) (void);
270 void (* _query_writable_namespaces_finish) (void);
272 gboolean (* set_attribute) (GFile *file,
273 const char *attribute,
274 GFileAttributeType type,
275 gpointer value_p,
276 GFileQueryInfoFlags flags,
277 GCancellable *cancellable,
278 GError **error);
279 gboolean (* set_attributes_from_info) (GFile *file,
280 GFileInfo *info,
281 GFileQueryInfoFlags flags,
282 GCancellable *cancellable,
283 GError **error);
284 void (* set_attributes_async) (GFile *file,
285 GFileInfo *info,
286 GFileQueryInfoFlags flags,
287 int io_priority,
288 GCancellable *cancellable,
289 GAsyncReadyCallback callback,
290 gpointer user_data);
291 gboolean (* set_attributes_finish) (GFile *file,
292 GAsyncResult *result,
293 GFileInfo **info,
294 GError **error);
296 GFileInputStream * (* read_fn) (GFile *file,
297 GCancellable *cancellable,
298 GError **error);
299 void (* read_async) (GFile *file,
300 int io_priority,
301 GCancellable *cancellable,
302 GAsyncReadyCallback callback,
303 gpointer user_data);
304 GFileInputStream * (* read_finish) (GFile *file,
305 GAsyncResult *res,
306 GError **error);
308 GFileOutputStream * (* append_to) (GFile *file,
309 GFileCreateFlags flags,
310 GCancellable *cancellable,
311 GError **error);
312 void (* append_to_async) (GFile *file,
313 GFileCreateFlags flags,
314 int io_priority,
315 GCancellable *cancellable,
316 GAsyncReadyCallback callback,
317 gpointer user_data);
318 GFileOutputStream * (* append_to_finish) (GFile *file,
319 GAsyncResult *res,
320 GError **error);
322 GFileOutputStream * (* create) (GFile *file,
323 GFileCreateFlags flags,
324 GCancellable *cancellable,
325 GError **error);
326 void (* create_async) (GFile *file,
327 GFileCreateFlags flags,
328 int io_priority,
329 GCancellable *cancellable,
330 GAsyncReadyCallback callback,
331 gpointer user_data);
332 GFileOutputStream * (* create_finish) (GFile *file,
333 GAsyncResult *res,
334 GError **error);
336 GFileOutputStream * (* replace) (GFile *file,
337 const char *etag,
338 gboolean make_backup,
339 GFileCreateFlags flags,
340 GCancellable *cancellable,
341 GError **error);
342 void (* replace_async) (GFile *file,
343 const char *etag,
344 gboolean make_backup,
345 GFileCreateFlags flags,
346 int io_priority,
347 GCancellable *cancellable,
348 GAsyncReadyCallback callback,
349 gpointer user_data);
350 GFileOutputStream * (* replace_finish) (GFile *file,
351 GAsyncResult *res,
352 GError **error);
354 gboolean (* delete_file) (GFile *file,
355 GCancellable *cancellable,
356 GError **error);
357 void (* delete_file_async) (GFile *file,
358 int io_priority,
359 GCancellable *cancellable,
360 GAsyncReadyCallback callback,
361 gpointer user_data);
362 gboolean (* delete_file_finish) (GFile *file,
363 GAsyncResult *result,
364 GError **error);
366 gboolean (* trash) (GFile *file,
367 GCancellable *cancellable,
368 GError **error);
369 void (* trash_async) (GFile *file,
370 int io_priority,
371 GCancellable *cancellable,
372 GAsyncReadyCallback callback,
373 gpointer user_data);
374 gboolean (* trash_finish) (GFile *file,
375 GAsyncResult *result,
376 GError **error);
378 gboolean (* make_directory) (GFile *file,
379 GCancellable *cancellable,
380 GError **error);
381 void (* make_directory_async) (GFile *file,
382 int io_priority,
383 GCancellable *cancellable,
384 GAsyncReadyCallback callback,
385 gpointer user_data);
386 gboolean (* make_directory_finish) (GFile *file,
387 GAsyncResult *result,
388 GError **error);
390 gboolean (* make_symbolic_link) (GFile *file,
391 const char *symlink_value,
392 GCancellable *cancellable,
393 GError **error);
394 void (* _make_symbolic_link_async) (void);
395 void (* _make_symbolic_link_finish) (void);
397 gboolean (* copy) (GFile *source,
398 GFile *destination,
399 GFileCopyFlags flags,
400 GCancellable *cancellable,
401 GFileProgressCallback progress_callback,
402 gpointer progress_callback_data,
403 GError **error);
404 void (* copy_async) (GFile *source,
405 GFile *destination,
406 GFileCopyFlags flags,
407 int io_priority,
408 GCancellable *cancellable,
409 GFileProgressCallback progress_callback,
410 gpointer progress_callback_data,
411 GAsyncReadyCallback callback,
412 gpointer user_data);
413 gboolean (* copy_finish) (GFile *file,
414 GAsyncResult *res,
415 GError **error);
417 gboolean (* move) (GFile *source,
418 GFile *destination,
419 GFileCopyFlags flags,
420 GCancellable *cancellable,
421 GFileProgressCallback progress_callback,
422 gpointer progress_callback_data,
423 GError **error);
424 void (* _move_async) (void);
425 void (* _move_finish) (void);
427 void (* mount_mountable) (GFile *file,
428 GMountMountFlags flags,
429 GMountOperation *mount_operation,
430 GCancellable *cancellable,
431 GAsyncReadyCallback callback,
432 gpointer user_data);
433 GFile * (* mount_mountable_finish) (GFile *file,
434 GAsyncResult *result,
435 GError **error);
437 void (* unmount_mountable) (GFile *file,
438 GMountUnmountFlags flags,
439 GCancellable *cancellable,
440 GAsyncReadyCallback callback,
441 gpointer user_data);
442 gboolean (* unmount_mountable_finish) (GFile *file,
443 GAsyncResult *result,
444 GError **error);
446 void (* eject_mountable) (GFile *file,
447 GMountUnmountFlags flags,
448 GCancellable *cancellable,
449 GAsyncReadyCallback callback,
450 gpointer user_data);
451 gboolean (* eject_mountable_finish) (GFile *file,
452 GAsyncResult *result,
453 GError **error);
455 void (* mount_enclosing_volume) (GFile *location,
456 GMountMountFlags flags,
457 GMountOperation *mount_operation,
458 GCancellable *cancellable,
459 GAsyncReadyCallback callback,
460 gpointer user_data);
461 gboolean (* mount_enclosing_volume_finish) (GFile *location,
462 GAsyncResult *result,
463 GError **error);
465 GFileMonitor * (* monitor_dir) (GFile *file,
466 GFileMonitorFlags flags,
467 GCancellable *cancellable,
468 GError **error);
469 GFileMonitor * (* monitor_file) (GFile *file,
470 GFileMonitorFlags flags,
471 GCancellable *cancellable,
472 GError **error);
474 GFileIOStream * (* open_readwrite) (GFile *file,
475 GCancellable *cancellable,
476 GError **error);
477 void (* open_readwrite_async) (GFile *file,
478 int io_priority,
479 GCancellable *cancellable,
480 GAsyncReadyCallback callback,
481 gpointer user_data);
482 GFileIOStream * (* open_readwrite_finish) (GFile *file,
483 GAsyncResult *res,
484 GError **error);
485 GFileIOStream * (* create_readwrite) (GFile *file,
486 GFileCreateFlags flags,
487 GCancellable *cancellable,
488 GError **error);
489 void (* create_readwrite_async) (GFile *file,
490 GFileCreateFlags flags,
491 int io_priority,
492 GCancellable *cancellable,
493 GAsyncReadyCallback callback,
494 gpointer user_data);
495 GFileIOStream * (* create_readwrite_finish) (GFile *file,
496 GAsyncResult *res,
497 GError **error);
498 GFileIOStream * (* replace_readwrite) (GFile *file,
499 const char *etag,
500 gboolean make_backup,
501 GFileCreateFlags flags,
502 GCancellable *cancellable,
503 GError **error);
504 void (* replace_readwrite_async) (GFile *file,
505 const char *etag,
506 gboolean make_backup,
507 GFileCreateFlags flags,
508 int io_priority,
509 GCancellable *cancellable,
510 GAsyncReadyCallback callback,
511 gpointer user_data);
512 GFileIOStream * (* replace_readwrite_finish) (GFile *file,
513 GAsyncResult *res,
514 GError **error);
516 void (* start_mountable) (GFile *file,
517 GDriveStartFlags flags,
518 GMountOperation *start_operation,
519 GCancellable *cancellable,
520 GAsyncReadyCallback callback,
521 gpointer user_data);
522 gboolean (* start_mountable_finish) (GFile *file,
523 GAsyncResult *result,
524 GError **error);
526 void (* stop_mountable) (GFile *file,
527 GMountUnmountFlags flags,
528 GMountOperation *mount_operation,
529 GCancellable *cancellable,
530 GAsyncReadyCallback callback,
531 gpointer user_data);
532 gboolean (* stop_mountable_finish) (GFile *file,
533 GAsyncResult *result,
534 GError **error);
536 gboolean supports_thread_contexts;
538 void (* unmount_mountable_with_operation) (GFile *file,
539 GMountUnmountFlags flags,
540 GMountOperation *mount_operation,
541 GCancellable *cancellable,
542 GAsyncReadyCallback callback,
543 gpointer user_data);
544 gboolean (* unmount_mountable_with_operation_finish) (GFile *file,
545 GAsyncResult *result,
546 GError **error);
548 void (* eject_mountable_with_operation) (GFile *file,
549 GMountUnmountFlags flags,
550 GMountOperation *mount_operation,
551 GCancellable *cancellable,
552 GAsyncReadyCallback callback,
553 gpointer user_data);
554 gboolean (* eject_mountable_with_operation_finish) (GFile *file,
555 GAsyncResult *result,
556 GError **error);
558 void (* poll_mountable) (GFile *file,
559 GCancellable *cancellable,
560 GAsyncReadyCallback callback,
561 gpointer user_data);
562 gboolean (* poll_mountable_finish) (GFile *file,
563 GAsyncResult *result,
564 GError **error);
566 gboolean (* measure_disk_usage) (GFile *file,
567 GFileMeasureFlags flags,
568 GCancellable *cancellable,
569 GFileMeasureProgressCallback progress_callback,
570 gpointer progress_data,
571 guint64 *disk_usage,
572 guint64 *num_dirs,
573 guint64 *num_files,
574 GError **error);
575 void (* measure_disk_usage_async) (GFile *file,
576 GFileMeasureFlags flags,
577 gint io_priority,
578 GCancellable *cancellable,
579 GFileMeasureProgressCallback progress_callback,
580 gpointer progress_data,
581 GAsyncReadyCallback callback,
582 gpointer user_data);
583 gboolean (* measure_disk_usage_finish) (GFile *file,
584 GAsyncResult *result,
585 guint64 *disk_usage,
586 guint64 *num_dirs,
587 guint64 *num_files,
588 GError **error);
591 GLIB_AVAILABLE_IN_ALL
592 GType g_file_get_type (void) G_GNUC_CONST;
594 GLIB_AVAILABLE_IN_ALL
595 GFile * g_file_new_for_path (const char *path);
596 GLIB_AVAILABLE_IN_ALL
597 GFile * g_file_new_for_uri (const char *uri);
598 GLIB_AVAILABLE_IN_ALL
599 GFile * g_file_new_for_commandline_arg (const char *arg);
600 GLIB_AVAILABLE_IN_2_36
601 GFile * g_file_new_for_commandline_arg_and_cwd (const gchar *arg,
602 const gchar *cwd);
603 GLIB_AVAILABLE_IN_2_32
604 GFile * g_file_new_tmp (const char *tmpl,
605 GFileIOStream **iostream,
606 GError **error);
607 GLIB_AVAILABLE_IN_ALL
608 GFile * g_file_parse_name (const char *parse_name);
609 GLIB_AVAILABLE_IN_2_56
610 GFile * g_file_new_build_filename (const gchar *first_element,
611 ...) G_GNUC_NULL_TERMINATED;
612 GLIB_AVAILABLE_IN_ALL
613 GFile * g_file_dup (GFile *file);
614 GLIB_AVAILABLE_IN_ALL
615 guint g_file_hash (gconstpointer file);
616 GLIB_AVAILABLE_IN_ALL
617 gboolean g_file_equal (GFile *file1,
618 GFile *file2);
619 GLIB_AVAILABLE_IN_ALL
620 char * g_file_get_basename (GFile *file);
621 GLIB_AVAILABLE_IN_ALL
622 char * g_file_get_path (GFile *file);
623 GLIB_AVAILABLE_IN_ALL
624 char * g_file_get_uri (GFile *file);
625 GLIB_AVAILABLE_IN_ALL
626 char * g_file_get_parse_name (GFile *file);
627 GLIB_AVAILABLE_IN_ALL
628 GFile * g_file_get_parent (GFile *file);
629 GLIB_AVAILABLE_IN_ALL
630 gboolean g_file_has_parent (GFile *file,
631 GFile *parent);
632 GLIB_AVAILABLE_IN_ALL
633 GFile * g_file_get_child (GFile *file,
634 const char *name);
635 GLIB_AVAILABLE_IN_ALL
636 GFile * g_file_get_child_for_display_name (GFile *file,
637 const char *display_name,
638 GError **error);
639 GLIB_AVAILABLE_IN_ALL
640 gboolean g_file_has_prefix (GFile *file,
641 GFile *prefix);
642 GLIB_AVAILABLE_IN_ALL
643 char * g_file_get_relative_path (GFile *parent,
644 GFile *descendant);
645 GLIB_AVAILABLE_IN_ALL
646 GFile * g_file_resolve_relative_path (GFile *file,
647 const char *relative_path);
648 GLIB_AVAILABLE_IN_ALL
649 gboolean g_file_is_native (GFile *file);
650 GLIB_AVAILABLE_IN_ALL
651 gboolean g_file_has_uri_scheme (GFile *file,
652 const char *uri_scheme);
653 GLIB_AVAILABLE_IN_ALL
654 char * g_file_get_uri_scheme (GFile *file);
655 GLIB_AVAILABLE_IN_ALL
656 GFileInputStream * g_file_read (GFile *file,
657 GCancellable *cancellable,
658 GError **error);
659 GLIB_AVAILABLE_IN_ALL
660 void g_file_read_async (GFile *file,
661 int io_priority,
662 GCancellable *cancellable,
663 GAsyncReadyCallback callback,
664 gpointer user_data);
665 GLIB_AVAILABLE_IN_ALL
666 GFileInputStream * g_file_read_finish (GFile *file,
667 GAsyncResult *res,
668 GError **error);
669 GLIB_AVAILABLE_IN_ALL
670 GFileOutputStream * g_file_append_to (GFile *file,
671 GFileCreateFlags flags,
672 GCancellable *cancellable,
673 GError **error);
674 GLIB_AVAILABLE_IN_ALL
675 GFileOutputStream * g_file_create (GFile *file,
676 GFileCreateFlags flags,
677 GCancellable *cancellable,
678 GError **error);
679 GLIB_AVAILABLE_IN_ALL
680 GFileOutputStream * g_file_replace (GFile *file,
681 const char *etag,
682 gboolean make_backup,
683 GFileCreateFlags flags,
684 GCancellable *cancellable,
685 GError **error);
686 GLIB_AVAILABLE_IN_ALL
687 void g_file_append_to_async (GFile *file,
688 GFileCreateFlags flags,
689 int io_priority,
690 GCancellable *cancellable,
691 GAsyncReadyCallback callback,
692 gpointer user_data);
693 GLIB_AVAILABLE_IN_ALL
694 GFileOutputStream * g_file_append_to_finish (GFile *file,
695 GAsyncResult *res,
696 GError **error);
697 GLIB_AVAILABLE_IN_ALL
698 void g_file_create_async (GFile *file,
699 GFileCreateFlags flags,
700 int io_priority,
701 GCancellable *cancellable,
702 GAsyncReadyCallback callback,
703 gpointer user_data);
704 GLIB_AVAILABLE_IN_ALL
705 GFileOutputStream * g_file_create_finish (GFile *file,
706 GAsyncResult *res,
707 GError **error);
708 GLIB_AVAILABLE_IN_ALL
709 void g_file_replace_async (GFile *file,
710 const char *etag,
711 gboolean make_backup,
712 GFileCreateFlags flags,
713 int io_priority,
714 GCancellable *cancellable,
715 GAsyncReadyCallback callback,
716 gpointer user_data);
717 GLIB_AVAILABLE_IN_ALL
718 GFileOutputStream * g_file_replace_finish (GFile *file,
719 GAsyncResult *res,
720 GError **error);
721 GLIB_AVAILABLE_IN_ALL
722 GFileIOStream * g_file_open_readwrite (GFile *file,
723 GCancellable *cancellable,
724 GError **error);
725 GLIB_AVAILABLE_IN_ALL
726 void g_file_open_readwrite_async (GFile *file,
727 int io_priority,
728 GCancellable *cancellable,
729 GAsyncReadyCallback callback,
730 gpointer user_data);
731 GLIB_AVAILABLE_IN_ALL
732 GFileIOStream * g_file_open_readwrite_finish (GFile *file,
733 GAsyncResult *res,
734 GError **error);
735 GLIB_AVAILABLE_IN_ALL
736 GFileIOStream * g_file_create_readwrite (GFile *file,
737 GFileCreateFlags flags,
738 GCancellable *cancellable,
739 GError **error);
740 GLIB_AVAILABLE_IN_ALL
741 void g_file_create_readwrite_async (GFile *file,
742 GFileCreateFlags flags,
743 int io_priority,
744 GCancellable *cancellable,
745 GAsyncReadyCallback callback,
746 gpointer user_data);
747 GLIB_AVAILABLE_IN_ALL
748 GFileIOStream * g_file_create_readwrite_finish (GFile *file,
749 GAsyncResult *res,
750 GError **error);
751 GLIB_AVAILABLE_IN_ALL
752 GFileIOStream * g_file_replace_readwrite (GFile *file,
753 const char *etag,
754 gboolean make_backup,
755 GFileCreateFlags flags,
756 GCancellable *cancellable,
757 GError **error);
758 GLIB_AVAILABLE_IN_ALL
759 void g_file_replace_readwrite_async (GFile *file,
760 const char *etag,
761 gboolean make_backup,
762 GFileCreateFlags flags,
763 int io_priority,
764 GCancellable *cancellable,
765 GAsyncReadyCallback callback,
766 gpointer user_data);
767 GLIB_AVAILABLE_IN_ALL
768 GFileIOStream * g_file_replace_readwrite_finish (GFile *file,
769 GAsyncResult *res,
770 GError **error);
771 GLIB_AVAILABLE_IN_ALL
772 gboolean g_file_query_exists (GFile *file,
773 GCancellable *cancellable);
774 GLIB_AVAILABLE_IN_ALL
775 GFileType g_file_query_file_type (GFile *file,
776 GFileQueryInfoFlags flags,
777 GCancellable *cancellable);
778 GLIB_AVAILABLE_IN_ALL
779 GFileInfo * g_file_query_info (GFile *file,
780 const char *attributes,
781 GFileQueryInfoFlags flags,
782 GCancellable *cancellable,
783 GError **error);
784 GLIB_AVAILABLE_IN_ALL
785 void g_file_query_info_async (GFile *file,
786 const char *attributes,
787 GFileQueryInfoFlags flags,
788 int io_priority,
789 GCancellable *cancellable,
790 GAsyncReadyCallback callback,
791 gpointer user_data);
792 GLIB_AVAILABLE_IN_ALL
793 GFileInfo * g_file_query_info_finish (GFile *file,
794 GAsyncResult *res,
795 GError **error);
796 GLIB_AVAILABLE_IN_ALL
797 GFileInfo * g_file_query_filesystem_info (GFile *file,
798 const char *attributes,
799 GCancellable *cancellable,
800 GError **error);
801 GLIB_AVAILABLE_IN_ALL
802 void g_file_query_filesystem_info_async (GFile *file,
803 const char *attributes,
804 int io_priority,
805 GCancellable *cancellable,
806 GAsyncReadyCallback callback,
807 gpointer user_data);
808 GLIB_AVAILABLE_IN_ALL
809 GFileInfo * g_file_query_filesystem_info_finish (GFile *file,
810 GAsyncResult *res,
811 GError **error);
812 GLIB_AVAILABLE_IN_ALL
813 GMount * g_file_find_enclosing_mount (GFile *file,
814 GCancellable *cancellable,
815 GError **error);
816 GLIB_AVAILABLE_IN_ALL
817 void g_file_find_enclosing_mount_async (GFile *file,
818 int io_priority,
819 GCancellable *cancellable,
820 GAsyncReadyCallback callback,
821 gpointer user_data);
822 GLIB_AVAILABLE_IN_ALL
823 GMount * g_file_find_enclosing_mount_finish (GFile *file,
824 GAsyncResult *res,
825 GError **error);
826 GLIB_AVAILABLE_IN_ALL
827 GFileEnumerator * g_file_enumerate_children (GFile *file,
828 const char *attributes,
829 GFileQueryInfoFlags flags,
830 GCancellable *cancellable,
831 GError **error);
832 GLIB_AVAILABLE_IN_ALL
833 void g_file_enumerate_children_async (GFile *file,
834 const char *attributes,
835 GFileQueryInfoFlags flags,
836 int io_priority,
837 GCancellable *cancellable,
838 GAsyncReadyCallback callback,
839 gpointer user_data);
840 GLIB_AVAILABLE_IN_ALL
841 GFileEnumerator * g_file_enumerate_children_finish (GFile *file,
842 GAsyncResult *res,
843 GError **error);
844 GLIB_AVAILABLE_IN_ALL
845 GFile * g_file_set_display_name (GFile *file,
846 const char *display_name,
847 GCancellable *cancellable,
848 GError **error);
849 GLIB_AVAILABLE_IN_ALL
850 void g_file_set_display_name_async (GFile *file,
851 const char *display_name,
852 int io_priority,
853 GCancellable *cancellable,
854 GAsyncReadyCallback callback,
855 gpointer user_data);
856 GLIB_AVAILABLE_IN_ALL
857 GFile * g_file_set_display_name_finish (GFile *file,
858 GAsyncResult *res,
859 GError **error);
860 GLIB_AVAILABLE_IN_ALL
861 gboolean g_file_delete (GFile *file,
862 GCancellable *cancellable,
863 GError **error);
865 GLIB_AVAILABLE_IN_2_34
866 void g_file_delete_async (GFile *file,
867 int io_priority,
868 GCancellable *cancellable,
869 GAsyncReadyCallback callback,
870 gpointer user_data);
872 GLIB_AVAILABLE_IN_2_34
873 gboolean g_file_delete_finish (GFile *file,
874 GAsyncResult *result,
875 GError **error);
877 GLIB_AVAILABLE_IN_ALL
878 gboolean g_file_trash (GFile *file,
879 GCancellable *cancellable,
880 GError **error);
882 GLIB_AVAILABLE_IN_2_38
883 void g_file_trash_async (GFile *file,
884 int io_priority,
885 GCancellable *cancellable,
886 GAsyncReadyCallback callback,
887 gpointer user_data);
889 GLIB_AVAILABLE_IN_2_38
890 gboolean g_file_trash_finish (GFile *file,
891 GAsyncResult *result,
892 GError **error);
894 GLIB_AVAILABLE_IN_ALL
895 gboolean g_file_copy (GFile *source,
896 GFile *destination,
897 GFileCopyFlags flags,
898 GCancellable *cancellable,
899 GFileProgressCallback progress_callback,
900 gpointer progress_callback_data,
901 GError **error);
902 GLIB_AVAILABLE_IN_ALL
903 void g_file_copy_async (GFile *source,
904 GFile *destination,
905 GFileCopyFlags flags,
906 int io_priority,
907 GCancellable *cancellable,
908 GFileProgressCallback progress_callback,
909 gpointer progress_callback_data,
910 GAsyncReadyCallback callback,
911 gpointer user_data);
912 GLIB_AVAILABLE_IN_ALL
913 gboolean g_file_copy_finish (GFile *file,
914 GAsyncResult *res,
915 GError **error);
916 GLIB_AVAILABLE_IN_ALL
917 gboolean g_file_move (GFile *source,
918 GFile *destination,
919 GFileCopyFlags flags,
920 GCancellable *cancellable,
921 GFileProgressCallback progress_callback,
922 gpointer progress_callback_data,
923 GError **error);
924 GLIB_AVAILABLE_IN_ALL
925 gboolean g_file_make_directory (GFile *file,
926 GCancellable *cancellable,
927 GError **error);
928 GLIB_AVAILABLE_IN_2_38
929 void g_file_make_directory_async (GFile *file,
930 int io_priority,
931 GCancellable *cancellable,
932 GAsyncReadyCallback callback,
933 gpointer user_data);
934 GLIB_AVAILABLE_IN_2_38
935 gboolean g_file_make_directory_finish (GFile *file,
936 GAsyncResult *result,
937 GError **error);
939 GLIB_AVAILABLE_IN_ALL
940 gboolean g_file_make_directory_with_parents (GFile *file,
941 GCancellable *cancellable,
942 GError **error);
943 GLIB_AVAILABLE_IN_ALL
944 gboolean g_file_make_symbolic_link (GFile *file,
945 const char *symlink_value,
946 GCancellable *cancellable,
947 GError **error);
948 GLIB_AVAILABLE_IN_ALL
949 GFileAttributeInfoList *g_file_query_settable_attributes (GFile *file,
950 GCancellable *cancellable,
951 GError **error);
952 GLIB_AVAILABLE_IN_ALL
953 GFileAttributeInfoList *g_file_query_writable_namespaces (GFile *file,
954 GCancellable *cancellable,
955 GError **error);
956 GLIB_AVAILABLE_IN_ALL
957 gboolean g_file_set_attribute (GFile *file,
958 const char *attribute,
959 GFileAttributeType type,
960 gpointer value_p,
961 GFileQueryInfoFlags flags,
962 GCancellable *cancellable,
963 GError **error);
964 GLIB_AVAILABLE_IN_ALL
965 gboolean g_file_set_attributes_from_info (GFile *file,
966 GFileInfo *info,
967 GFileQueryInfoFlags flags,
968 GCancellable *cancellable,
969 GError **error);
970 GLIB_AVAILABLE_IN_ALL
971 void g_file_set_attributes_async (GFile *file,
972 GFileInfo *info,
973 GFileQueryInfoFlags flags,
974 int io_priority,
975 GCancellable *cancellable,
976 GAsyncReadyCallback callback,
977 gpointer user_data);
978 GLIB_AVAILABLE_IN_ALL
979 gboolean g_file_set_attributes_finish (GFile *file,
980 GAsyncResult *result,
981 GFileInfo **info,
982 GError **error);
983 GLIB_AVAILABLE_IN_ALL
984 gboolean g_file_set_attribute_string (GFile *file,
985 const char *attribute,
986 const char *value,
987 GFileQueryInfoFlags flags,
988 GCancellable *cancellable,
989 GError **error);
990 GLIB_AVAILABLE_IN_ALL
991 gboolean g_file_set_attribute_byte_string (GFile *file,
992 const char *attribute,
993 const char *value,
994 GFileQueryInfoFlags flags,
995 GCancellable *cancellable,
996 GError **error);
997 GLIB_AVAILABLE_IN_ALL
998 gboolean g_file_set_attribute_uint32 (GFile *file,
999 const char *attribute,
1000 guint32 value,
1001 GFileQueryInfoFlags flags,
1002 GCancellable *cancellable,
1003 GError **error);
1004 GLIB_AVAILABLE_IN_ALL
1005 gboolean g_file_set_attribute_int32 (GFile *file,
1006 const char *attribute,
1007 gint32 value,
1008 GFileQueryInfoFlags flags,
1009 GCancellable *cancellable,
1010 GError **error);
1011 GLIB_AVAILABLE_IN_ALL
1012 gboolean g_file_set_attribute_uint64 (GFile *file,
1013 const char *attribute,
1014 guint64 value,
1015 GFileQueryInfoFlags flags,
1016 GCancellable *cancellable,
1017 GError **error);
1018 GLIB_AVAILABLE_IN_ALL
1019 gboolean g_file_set_attribute_int64 (GFile *file,
1020 const char *attribute,
1021 gint64 value,
1022 GFileQueryInfoFlags flags,
1023 GCancellable *cancellable,
1024 GError **error);
1025 GLIB_AVAILABLE_IN_ALL
1026 void g_file_mount_enclosing_volume (GFile *location,
1027 GMountMountFlags flags,
1028 GMountOperation *mount_operation,
1029 GCancellable *cancellable,
1030 GAsyncReadyCallback callback,
1031 gpointer user_data);
1032 GLIB_AVAILABLE_IN_ALL
1033 gboolean g_file_mount_enclosing_volume_finish (GFile *location,
1034 GAsyncResult *result,
1035 GError **error);
1036 GLIB_AVAILABLE_IN_ALL
1037 void g_file_mount_mountable (GFile *file,
1038 GMountMountFlags flags,
1039 GMountOperation *mount_operation,
1040 GCancellable *cancellable,
1041 GAsyncReadyCallback callback,
1042 gpointer user_data);
1043 GLIB_AVAILABLE_IN_ALL
1044 GFile * g_file_mount_mountable_finish (GFile *file,
1045 GAsyncResult *result,
1046 GError **error);
1047 GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation)
1048 void g_file_unmount_mountable (GFile *file,
1049 GMountUnmountFlags flags,
1050 GCancellable *cancellable,
1051 GAsyncReadyCallback callback,
1052 gpointer user_data);
1054 GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation_finish)
1055 gboolean g_file_unmount_mountable_finish (GFile *file,
1056 GAsyncResult *result,
1057 GError **error);
1058 GLIB_AVAILABLE_IN_ALL
1059 void g_file_unmount_mountable_with_operation (GFile *file,
1060 GMountUnmountFlags flags,
1061 GMountOperation *mount_operation,
1062 GCancellable *cancellable,
1063 GAsyncReadyCallback callback,
1064 gpointer user_data);
1065 GLIB_AVAILABLE_IN_ALL
1066 gboolean g_file_unmount_mountable_with_operation_finish (GFile *file,
1067 GAsyncResult *result,
1068 GError **error);
1069 GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation)
1070 void g_file_eject_mountable (GFile *file,
1071 GMountUnmountFlags flags,
1072 GCancellable *cancellable,
1073 GAsyncReadyCallback callback,
1074 gpointer user_data);
1076 GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation_finish)
1077 gboolean g_file_eject_mountable_finish (GFile *file,
1078 GAsyncResult *result,
1079 GError **error);
1080 GLIB_AVAILABLE_IN_ALL
1081 void g_file_eject_mountable_with_operation (GFile *file,
1082 GMountUnmountFlags flags,
1083 GMountOperation *mount_operation,
1084 GCancellable *cancellable,
1085 GAsyncReadyCallback callback,
1086 gpointer user_data);
1087 GLIB_AVAILABLE_IN_ALL
1088 gboolean g_file_eject_mountable_with_operation_finish (GFile *file,
1089 GAsyncResult *result,
1090 GError **error);
1092 GLIB_AVAILABLE_IN_ALL
1093 gboolean g_file_copy_attributes (GFile *source,
1094 GFile *destination,
1095 GFileCopyFlags flags,
1096 GCancellable *cancellable,
1097 GError **error);
1100 GLIB_AVAILABLE_IN_ALL
1101 GFileMonitor* g_file_monitor_directory (GFile *file,
1102 GFileMonitorFlags flags,
1103 GCancellable *cancellable,
1104 GError **error);
1105 GLIB_AVAILABLE_IN_ALL
1106 GFileMonitor* g_file_monitor_file (GFile *file,
1107 GFileMonitorFlags flags,
1108 GCancellable *cancellable,
1109 GError **error);
1110 GLIB_AVAILABLE_IN_ALL
1111 GFileMonitor* g_file_monitor (GFile *file,
1112 GFileMonitorFlags flags,
1113 GCancellable *cancellable,
1114 GError **error);
1116 GLIB_AVAILABLE_IN_2_38
1117 gboolean g_file_measure_disk_usage (GFile *file,
1118 GFileMeasureFlags flags,
1119 GCancellable *cancellable,
1120 GFileMeasureProgressCallback progress_callback,
1121 gpointer progress_data,
1122 guint64 *disk_usage,
1123 guint64 *num_dirs,
1124 guint64 *num_files,
1125 GError **error);
1127 GLIB_AVAILABLE_IN_2_38
1128 void g_file_measure_disk_usage_async (GFile *file,
1129 GFileMeasureFlags flags,
1130 gint io_priority,
1131 GCancellable *cancellable,
1132 GFileMeasureProgressCallback progress_callback,
1133 gpointer progress_data,
1134 GAsyncReadyCallback callback,
1135 gpointer user_data);
1137 GLIB_AVAILABLE_IN_2_38
1138 gboolean g_file_measure_disk_usage_finish (GFile *file,
1139 GAsyncResult *result,
1140 guint64 *disk_usage,
1141 guint64 *num_dirs,
1142 guint64 *num_files,
1143 GError **error);
1145 GLIB_AVAILABLE_IN_ALL
1146 void g_file_start_mountable (GFile *file,
1147 GDriveStartFlags flags,
1148 GMountOperation *start_operation,
1149 GCancellable *cancellable,
1150 GAsyncReadyCallback callback,
1151 gpointer user_data);
1152 GLIB_AVAILABLE_IN_ALL
1153 gboolean g_file_start_mountable_finish (GFile *file,
1154 GAsyncResult *result,
1155 GError **error);
1156 GLIB_AVAILABLE_IN_ALL
1157 void g_file_stop_mountable (GFile *file,
1158 GMountUnmountFlags flags,
1159 GMountOperation *mount_operation,
1160 GCancellable *cancellable,
1161 GAsyncReadyCallback callback,
1162 gpointer user_data);
1163 GLIB_AVAILABLE_IN_ALL
1164 gboolean g_file_stop_mountable_finish (GFile *file,
1165 GAsyncResult *result,
1166 GError **error);
1168 GLIB_AVAILABLE_IN_ALL
1169 void g_file_poll_mountable (GFile *file,
1170 GCancellable *cancellable,
1171 GAsyncReadyCallback callback,
1172 gpointer user_data);
1173 GLIB_AVAILABLE_IN_ALL
1174 gboolean g_file_poll_mountable_finish (GFile *file,
1175 GAsyncResult *result,
1176 GError **error);
1178 /* Utilities */
1180 GLIB_AVAILABLE_IN_ALL
1181 GAppInfo *g_file_query_default_handler (GFile *file,
1182 GCancellable *cancellable,
1183 GError **error);
1184 GLIB_AVAILABLE_IN_ALL
1185 gboolean g_file_load_contents (GFile *file,
1186 GCancellable *cancellable,
1187 char **contents,
1188 gsize *length,
1189 char **etag_out,
1190 GError **error);
1191 GLIB_AVAILABLE_IN_ALL
1192 void g_file_load_contents_async (GFile *file,
1193 GCancellable *cancellable,
1194 GAsyncReadyCallback callback,
1195 gpointer user_data);
1196 GLIB_AVAILABLE_IN_ALL
1197 gboolean g_file_load_contents_finish (GFile *file,
1198 GAsyncResult *res,
1199 char **contents,
1200 gsize *length,
1201 char **etag_out,
1202 GError **error);
1203 GLIB_AVAILABLE_IN_ALL
1204 void g_file_load_partial_contents_async (GFile *file,
1205 GCancellable *cancellable,
1206 GFileReadMoreCallback read_more_callback,
1207 GAsyncReadyCallback callback,
1208 gpointer user_data);
1209 GLIB_AVAILABLE_IN_ALL
1210 gboolean g_file_load_partial_contents_finish (GFile *file,
1211 GAsyncResult *res,
1212 char **contents,
1213 gsize *length,
1214 char **etag_out,
1215 GError **error);
1216 GLIB_AVAILABLE_IN_ALL
1217 gboolean g_file_replace_contents (GFile *file,
1218 const char *contents,
1219 gsize length,
1220 const char *etag,
1221 gboolean make_backup,
1222 GFileCreateFlags flags,
1223 char **new_etag,
1224 GCancellable *cancellable,
1225 GError **error);
1226 GLIB_AVAILABLE_IN_ALL
1227 void g_file_replace_contents_async (GFile *file,
1228 const char *contents,
1229 gsize length,
1230 const char *etag,
1231 gboolean make_backup,
1232 GFileCreateFlags flags,
1233 GCancellable *cancellable,
1234 GAsyncReadyCallback callback,
1235 gpointer user_data);
1236 GLIB_AVAILABLE_IN_2_40
1237 void g_file_replace_contents_bytes_async (GFile *file,
1238 GBytes *contents,
1239 const char *etag,
1240 gboolean make_backup,
1241 GFileCreateFlags flags,
1242 GCancellable *cancellable,
1243 GAsyncReadyCallback callback,
1244 gpointer user_data);
1245 GLIB_AVAILABLE_IN_ALL
1246 gboolean g_file_replace_contents_finish (GFile *file,
1247 GAsyncResult *res,
1248 char **new_etag,
1249 GError **error);
1251 GLIB_AVAILABLE_IN_ALL
1252 gboolean g_file_supports_thread_contexts (GFile *file);
1254 GLIB_AVAILABLE_IN_2_56
1255 GBytes *g_file_load_bytes (GFile *file,
1256 GCancellable *cancellable,
1257 gchar **etag_out,
1258 GError **error);
1259 GLIB_AVAILABLE_IN_2_56
1260 void g_file_load_bytes_async (GFile *file,
1261 GCancellable *cancellable,
1262 GAsyncReadyCallback callback,
1263 gpointer user_data);
1264 GLIB_AVAILABLE_IN_2_56
1265 GBytes *g_file_load_bytes_finish (GFile *file,
1266 GAsyncResult *result,
1267 gchar **etag_out,
1268 GError **error);
1270 G_END_DECLS
1272 #endif /* __G_FILE_H__ */