You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1018 lines
64 KiB

  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright (C) 2006-2007 Red Hat, Inc.
  4. *
  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 of the License, or (at your option) any later version.
  9. *
  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.
  14. *
  15. * You should have received a copy of the GNU Lesser General
  16. * Public License along with this library; if not, write to the
  17. * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  18. * Boston, MA 02111-1307, USA.
  19. *
  20. * Author: Alexander Larsson <alexl@redhat.com>
  21. */
  22. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  23. #error "Only <gio/gio.h> can be included directly."
  24. #endif
  25. #ifndef __G_FILE_H__
  26. #define __G_FILE_H__
  27. #include <gio/giotypes.h>
  28. G_BEGIN_DECLS
  29. #define G_TYPE_FILE (g_file_get_type ())
  30. #define G_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_FILE, GFile))
  31. #define G_IS_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_FILE))
  32. #define G_FILE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_FILE, GFileIface))
  33. #if 0
  34. /**
  35. * GFile:
  36. *
  37. * A handle to an object implementing the #GFileIface interface.
  38. * Generally stores a location within the file system. Handles do not
  39. * necessarily represent files or directories that currently exist.
  40. **/
  41. typedef struct _GFile GFile; /* Dummy typedef */
  42. #endif
  43. typedef struct _GFileIface GFileIface;
  44. /**
  45. * GFileIface:
  46. * @g_iface: The parent interface.
  47. * @dup: Duplicates a #GFile.
  48. * @hash: Creates a hash of a #GFile.
  49. * @equal: Checks equality of two given #GFile<!-- -->s.
  50. * @is_native: Checks to see if a file is native to the system.
  51. * @has_uri_scheme: Checks to see if a #GFile has a given URI scheme.
  52. * @get_uri_scheme: Gets the URI scheme for a #GFile.
  53. * @get_basename: Gets the basename for a given #GFile.
  54. * @get_path: Gets the current path within a #GFile.
  55. * @get_uri: Gets a URI for the path within a #GFile.
  56. * @get_parse_name: Gets the parsed name for the #GFile.
  57. * @get_parent: Gets the parent directory for the #GFile.
  58. * @prefix_matches: Checks whether a #GFile contains a specified file.
  59. * @get_relative_path: Gets the path for a #GFile relative to a given path.
  60. * @resolve_relative_path: Resolves a relative path for a #GFile to an absolute path.
  61. * @get_child_for_display_name: Gets the child #GFile for a given display name.
  62. * @enumerate_children: Gets a #GFileEnumerator with the children of a #GFile.
  63. * @enumerate_children_async: Asynchronously gets a #GFileEnumerator with the children of a #GFile.
  64. * @enumerate_children_finish: Finishes asynchronously enumerating the children.
  65. * @query_info: Gets the #GFileInfo for a #GFile.
  66. * @query_info_async: Asynchronously gets the #GFileInfo for a #GFile.
  67. * @query_info_finish: Finishes an asynchronous query info operation.
  68. * @query_filesystem_info: Gets a #GFileInfo for the file system #GFile is on.
  69. * @query_filesystem_info_async: Asynchronously gets a #GFileInfo for the file system #GFile is on.
  70. * @query_filesystem_info_finish: Finishes asynchronously getting the file system info.
  71. * @find_enclosing_mount: Gets a #GMount for the #GFile.
  72. * @find_enclosing_mount_async: Asynchronously gets the #GMount for a #GFile.
  73. * @find_enclosing_mount_finish: Finishes asynchronously getting the volume.
  74. * @set_display_name: Sets the display name for a #GFile.
  75. * @set_display_name_async: Asynchronously sets a #GFile's display name.
  76. * @set_display_name_finish: Finishes asynchronously setting a #GFile's display name.
  77. * @query_settable_attributes: Returns a list of #GFileAttribute<!-- -->s that can be set.
  78. * @_query_settable_attributes_async: Asynchronously gets a list of #GFileAttribute<!-- -->s that can be set.
  79. * @_query_settable_attributes_finish: Finishes asynchronously querying settable attributes.
  80. * @query_writable_namespaces: Returns a list of #GFileAttribute namespaces that are writable.
  81. * @_query_writable_namespaces_async: Asynchronously gets a list of #GFileAttribute namespaces that are writable.
  82. * @_query_writable_namespaces_finish: Finishes asynchronously querying the writable namespaces.
  83. * @set_attribute: Sets a #GFileAttribute.
  84. * @set_attributes_from_info: Sets a #GFileAttribute with information from a #GFileInfo.
  85. * @set_attributes_async: Asynchronously sets a file's attributes.
  86. * @set_attributes_finish: Finishes setting a file's attributes asynchronously.
  87. * @read_fn: Reads a file asynchronously.
  88. * @read_async: Asynchronously reads a file.
  89. * @read_finish: Finishes asynchronously reading a file.
  90. * @append_to: Writes to the end of a file.
  91. * @append_to_async: Asynchronously writes to the end of a file.
  92. * @append_to_finish: Finishes an asynchronous file append operation.
  93. * @create: Creates a new file.
  94. * @create_async: Asynchronously creates a file.
  95. * @create_finish: Finishes asynchronously creating a file.
  96. * @replace: Replaces the contents of a file.
  97. * @replace_async: Asynchronously replaces the contents of a file.
  98. * @replace_finish: Finishes asynchronously replacing a file.
  99. * @delete_file: Deletes a file.
  100. * @_delete_file_async: Asynchronously deletes a file.
  101. * @_delete_file_finish: Finishes an asynchronous delete.
  102. * @trash: Sends a #GFile to the Trash location.
  103. * @_trash_async: Asynchronously sends a #GFile to the Trash location.
  104. * @_trash_finish: Finishes an asynchronous file trashing operation.
  105. * @make_directory: Makes a directory.
  106. * @_make_directory_async: Asynchronously makes a directory.
  107. * @_make_directory_finish: Finishes making a directory asynchronously.
  108. * @make_symbolic_link: Makes a symbolic link.
  109. * @_make_symbolic_link_async: Asynchronously makes a symbolic link
  110. * @_make_symbolic_link_finish: Finishes making a symbolic link asynchronously.
  111. * @copy: Copies a file.
  112. * @copy_async: Asynchronously copies a file.
  113. * @copy_finish: Finishes an asynchronous copy operation.
  114. * @move: Moves a file.
  115. * @_move_async: Asynchronously moves a file.
  116. * @_move_finish: Finishes an asynchronous move operation.
  117. * @mount_mountable: Mounts a mountable object.
  118. * @mount_mountable_finish: Finishes a mounting operation.
  119. * @unmount_mountable: Unmounts a mountable object.
  120. * @unmount_mountable_finish: Finishes an unmount operation.
  121. * @eject_mountable: Ejects a mountable.
  122. * @eject_mountable_finish: Finishes an eject operation.
  123. * @mount_enclosing_volume: Mounts a specified location.
  124. * @mount_enclosing_volume_finish: Finishes mounting a specified location.
  125. * @monitor_dir: Creates a #GFileMonitor for the location.
  126. * @monitor_file: Creates a #GFileMonitor for the location.
  127. * @open_readwrite: Open file read/write. Since 2.22.
  128. * @open_readwrite_async: Asynchronously opens file read/write. Since 2.22.
  129. * @open_readwrite_finish: Finishes an asynchronous open read/write. Since 2.22.
  130. * @create_readwrite: Creates file read/write. Since 2.22.
  131. * @create_readwrite_async: Asynchronously creates file read/write. Since 2.22.
  132. * @create_readwrite_finish: Finishes an asynchronous creates read/write. Since 2.22.
  133. * @replace_readwrite: Replaces file read/write. Since 2.22.
  134. * @replace_readwrite_async: Asynchronously replaces file read/write. Since 2.22.
  135. * @replace_readwrite_finish: Finishes an asynchronous replace read/write. Since 2.22.
  136. * @start_mountable: Starts a mountable object. Since 2.22.
  137. * @start_mountable_finish: Finishes an start operation. Since 2.22.
  138. * @stop_mountable: Stops a mountable. Since 2.22.
  139. * @stop_mountable_finish: Finishes an stop operation. Since 2.22.
  140. * @supports_thread_contexts: a boolean that indicates whether the #GFile implementation supports thread-default contexts. Since 2.22.
  141. * @unmount_mountable_with_operation: Unmounts a mountable object using a #GMountOperation. Since 2.22.
  142. * @unmount_mountable_with_operation_finish: Finishes an unmount operation using a #GMountOperation. Since 2.22.
  143. * @eject_mountable_with_operation: Ejects a mountable object using a #GMountOperation. Since 2.22.
  144. * @eject_mountable_with_operation_finish: Finishes an eject operation using a #GMountOperation. Since 2.22.
  145. * @poll_mountable: Polls a mountable object for media changes. Since 2.22.
  146. * @poll_mountable_finish: Finishes an poll operation for media changes. Since 2.22.
  147. *
  148. * An interface for writing VFS file handles.
  149. **/
  150. struct _GFileIface
  151. {
  152. GTypeInterface g_iface;
  153. /* Virtual Table */
  154. GFile * (* dup) (GFile *file);
  155. guint (* hash) (GFile *file);
  156. gboolean (* equal) (GFile *file1,
  157. GFile *file2);
  158. gboolean (* is_native) (GFile *file);
  159. gboolean (* has_uri_scheme) (GFile *file,
  160. const char *uri_scheme);
  161. char * (* get_uri_scheme) (GFile *file);
  162. char * (* get_basename) (GFile *file);
  163. char * (* get_path) (GFile *file);
  164. char * (* get_uri) (GFile *file);
  165. char * (* get_parse_name) (GFile *file);
  166. GFile * (* get_parent) (GFile *file);
  167. gboolean (* prefix_matches) (GFile *prefix,
  168. GFile *file);
  169. char * (* get_relative_path) (GFile *parent,
  170. GFile *descendant);
  171. GFile * (* resolve_relative_path) (GFile *file,
  172. const char *relative_path);
  173. GFile * (* get_child_for_display_name) (GFile *file,
  174. const char *display_name,
  175. GError **error);
  176. GFileEnumerator * (* enumerate_children) (GFile *file,
  177. const char *attributes,
  178. GFileQueryInfoFlags flags,
  179. GCancellable *cancellable,
  180. GError **error);
  181. void (* enumerate_children_async) (GFile *file,
  182. const char *attributes,
  183. GFileQueryInfoFlags flags,
  184. int io_priority,
  185. GCancellable *cancellable,
  186. GAsyncReadyCallback callback,
  187. gpointer user_data);
  188. GFileEnumerator * (* enumerate_children_finish) (GFile *file,
  189. GAsyncResult *res,
  190. GError **error);
  191. GFileInfo * (* query_info) (GFile *file,
  192. const char *attributes,
  193. GFileQueryInfoFlags flags,
  194. GCancellable *cancellable,
  195. GError **error);
  196. void (* query_info_async) (GFile *file,
  197. const char *attributes,
  198. GFileQueryInfoFlags flags,
  199. int io_priority,
  200. GCancellable *cancellable,
  201. GAsyncReadyCallback callback,
  202. gpointer user_data);
  203. GFileInfo * (* query_info_finish) (GFile *file,
  204. GAsyncResult *res,
  205. GError **error);
  206. GFileInfo * (* query_filesystem_info) (GFile *file,
  207. const char *attributes,
  208. GCancellable *cancellable,
  209. GError **error);
  210. void (* query_filesystem_info_async) (GFile *file,
  211. const char *attributes,
  212. int io_priority,
  213. GCancellable *cancellable,
  214. GAsyncReadyCallback callback,
  215. gpointer user_data);
  216. GFileInfo * (* query_filesystem_info_finish)(GFile *file,
  217. GAsyncResult *res,
  218. GError **error);
  219. GMount * (* find_enclosing_mount) (GFile *file,
  220. GCancellable *cancellable,
  221. GError **error);
  222. void (* find_enclosing_mount_async) (GFile *file,
  223. int io_priority,
  224. GCancellable *cancellable,
  225. GAsyncReadyCallback callback,
  226. gpointer user_data);
  227. GMount * (* find_enclosing_mount_finish) (GFile *file,
  228. GAsyncResult *res,
  229. GError **error);
  230. GFile * (* set_display_name) (GFile *file,
  231. const char *display_name,
  232. GCancellable *cancellable,
  233. GError **error);
  234. void (* set_display_name_async) (GFile *file,
  235. const char *display_name,
  236. int io_priority,
  237. GCancellable *cancellable,
  238. GAsyncReadyCallback callback,
  239. gpointer user_data);
  240. GFile * (* set_display_name_finish) (GFile *file,
  241. GAsyncResult *res,
  242. GError **error);
  243. GFileAttributeInfoList * (* query_settable_attributes) (GFile *file,
  244. GCancellable *cancellable,
  245. GError **error);
  246. void (* _query_settable_attributes_async) (void);
  247. void (* _query_settable_attributes_finish) (void);
  248. GFileAttributeInfoList * (* query_writable_namespaces) (GFile *file,
  249. GCancellable *cancellable,
  250. GError **error);
  251. void (* _query_writable_namespaces_async) (void);
  252. void (* _query_writable_namespaces_finish) (void);
  253. gboolean (* set_attribute) (GFile *file,
  254. const char *attribute,
  255. GFileAttributeType type,
  256. gpointer value_p,
  257. GFileQueryInfoFlags flags,
  258. GCancellable *cancellable,
  259. GError **error);
  260. gboolean (* set_attributes_from_info) (GFile *file,
  261. GFileInfo *info,
  262. GFileQueryInfoFlags flags,
  263. GCancellable *cancellable,
  264. GError **error);
  265. void (* set_attributes_async) (GFile *file,
  266. GFileInfo *info,
  267. GFileQueryInfoFlags flags,
  268. int io_priority,
  269. GCancellable *cancellable,
  270. GAsyncReadyCallback callback,
  271. gpointer user_data);
  272. gboolean (* set_attributes_finish) (GFile *file,
  273. GAsyncResult *result,
  274. GFileInfo **info,
  275. GError **error);
  276. GFileInputStream * (* read_fn) (GFile *file,
  277. GCancellable *cancellable,
  278. GError **error);
  279. void (* read_async) (GFile *file,
  280. int io_priority,
  281. GCancellable *cancellable,
  282. GAsyncReadyCallback callback,
  283. gpointer user_data);
  284. GFileInputStream * (* read_finish) (GFile *file,
  285. GAsyncResult *res,
  286. GError **error);
  287. GFileOutputStream * (* append_to) (GFile *file,
  288. GFileCreateFlags flags,
  289. GCancellable *cancellable,
  290. GError **error);
  291. void (* append_to_async) (GFile *file,
  292. GFileCreateFlags flags,
  293. int io_priority,
  294. GCancellable *cancellable,
  295. GAsyncReadyCallback callback,
  296. gpointer user_data);
  297. GFileOutputStream * (* append_to_finish) (GFile *file,
  298. GAsyncResult *res,
  299. GError **error);
  300. GFileOutputStream * (* create) (GFile *file,
  301. GFileCreateFlags flags,
  302. GCancellable *cancellable,
  303. GError **error);
  304. void (* create_async) (GFile *file,
  305. GFileCreateFlags flags,
  306. int io_priority,
  307. GCancellable *cancellable,
  308. GAsyncReadyCallback callback,
  309. gpointer user_data);
  310. GFileOutputStream * (* create_finish) (GFile *file,
  311. GAsyncResult *res,
  312. GError **error);
  313. GFileOutputStream * (* replace) (GFile *file,
  314. const char *etag,
  315. gboolean make_backup,
  316. GFileCreateFlags flags,
  317. GCancellable *cancellable,
  318. GError **error);
  319. void (* replace_async) (GFile *file,
  320. const char *etag,
  321. gboolean make_backup,
  322. GFileCreateFlags flags,
  323. int io_priority,
  324. GCancellable *cancellable,
  325. GAsyncReadyCallback callback,
  326. gpointer user_data);
  327. GFileOutputStream * (* replace_finish) (GFile *file,
  328. GAsyncResult *res,
  329. GError **error);
  330. gboolean (* delete_file) (GFile *file,
  331. GCancellable *cancellable,
  332. GError **error);
  333. void (* _delete_file_async) (void);
  334. void (* _delete_file_finish) (void);
  335. gboolean (* trash) (GFile *file,
  336. GCancellable *cancellable,
  337. GError **error);
  338. void (* _trash_async) (void);
  339. void (* _trash_finish) (void);
  340. gboolean (* make_directory) (GFile *file,
  341. GCancellable *cancellable,
  342. GError **error);
  343. void (* _make_directory_async) (void);
  344. void (* _make_directory_finish) (void);
  345. gboolean (* make_symbolic_link) (GFile *file,
  346. const char *symlink_value,
  347. GCancellable *cancellable,
  348. GError **error);
  349. void (* _make_symbolic_link_async) (void);
  350. void (* _make_symbolic_link_finish) (void);
  351. gboolean (* copy) (GFile *source,
  352. GFile *destination,
  353. GFileCopyFlags flags,
  354. GCancellable *cancellable,
  355. GFileProgressCallback progress_callback,
  356. gpointer progress_callback_data,
  357. GError **error);
  358. void (* copy_async) (GFile *source,
  359. GFile *destination,
  360. GFileCopyFlags flags,
  361. int io_priority,
  362. GCancellable *cancellable,
  363. GFileProgressCallback progress_callback,
  364. gpointer progress_callback_data,
  365. GAsyncReadyCallback callback,
  366. gpointer user_data);
  367. gboolean (* copy_finish) (GFile *file,
  368. GAsyncResult *res,
  369. GError **error);
  370. gboolean (* move) (GFile *source,
  371. GFile *destination,
  372. GFileCopyFlags flags,
  373. GCancellable *cancellable,
  374. GFileProgressCallback progress_callback,
  375. gpointer progress_callback_data,
  376. GError **error);
  377. void (* _move_async) (void);
  378. void (* _move_finish) (void);
  379. void (* mount_mountable) (GFile *file,
  380. GMountMountFlags flags,
  381. GMountOperation *mount_operation,
  382. GCancellable *cancellable,
  383. GAsyncReadyCallback callback,
  384. gpointer user_data);
  385. GFile * (* mount_mountable_finish) (GFile *file,
  386. GAsyncResult *result,
  387. GError **error);
  388. void (* unmount_mountable) (GFile *file,
  389. GMountUnmountFlags flags,
  390. GCancellable *cancellable,
  391. GAsyncReadyCallback callback,
  392. gpointer user_data);
  393. gboolean (* unmount_mountable_finish) (GFile *file,
  394. GAsyncResult *result,
  395. GError **error);
  396. void (* eject_mountable) (GFile *file,
  397. GMountUnmountFlags flags,
  398. GCancellable *cancellable,
  399. GAsyncReadyCallback callback,
  400. gpointer user_data);
  401. gboolean (* eject_mountable_finish) (GFile *file,
  402. GAsyncResult *result,
  403. GError **error);
  404. void (* mount_enclosing_volume) (GFile *location,
  405. GMountMountFlags flags,
  406. GMountOperation *mount_operation,
  407. GCancellable *cancellable,
  408. GAsyncReadyCallback callback,
  409. gpointer user_data);
  410. gboolean (* mount_enclosing_volume_finish) (GFile *location,
  411. GAsyncResult *result,
  412. GError **error);
  413. GFileMonitor * (* monitor_dir) (GFile *file,
  414. GFileMonitorFlags flags,
  415. GCancellable *cancellable,
  416. GError **error);
  417. GFileMonitor * (* monitor_file) (GFile *file,
  418. GFileMonitorFlags flags,
  419. GCancellable *cancellable,
  420. GError **error);
  421. GFileIOStream * (* open_readwrite) (GFile *file,
  422. GCancellable *cancellable,
  423. GError **error);
  424. void (* open_readwrite_async) (GFile *file,
  425. int io_priority,
  426. GCancellable *cancellable,
  427. GAsyncReadyCallback callback,
  428. gpointer user_data);
  429. GFileIOStream * (* open_readwrite_finish) (GFile *file,
  430. GAsyncResult *res,
  431. GError **error);
  432. GFileIOStream * (* create_readwrite) (GFile *file,
  433. GFileCreateFlags flags,
  434. GCancellable *cancellable,
  435. GError **error);
  436. void (* create_readwrite_async) (GFile *file,
  437. GFileCreateFlags flags,
  438. int io_priority,
  439. GCancellable *cancellable,
  440. GAsyncReadyCallback callback,
  441. gpointer user_data);
  442. GFileIOStream * (* create_readwrite_finish) (GFile *file,
  443. GAsyncResult *res,
  444. GError **error);
  445. GFileIOStream * (* replace_readwrite) (GFile *file,
  446. const char *etag,
  447. gboolean make_backup,
  448. GFileCreateFlags flags,
  449. GCancellable *cancellable,
  450. GError **error);
  451. void (* replace_readwrite_async) (GFile *file,
  452. const char *etag,
  453. gboolean make_backup,
  454. GFileCreateFlags flags,
  455. int io_priority,
  456. GCancellable *cancellable,
  457. GAsyncReadyCallback callback,
  458. gpointer user_data);
  459. GFileIOStream * (* replace_readwrite_finish) (GFile *file,
  460. GAsyncResult *res,
  461. GError **error);
  462. void (* start_mountable) (GFile *file,
  463. GDriveStartFlags flags,
  464. GMountOperation *start_operation,
  465. GCancellable *cancellable,
  466. GAsyncReadyCallback callback,
  467. gpointer user_data);
  468. gboolean (* start_mountable_finish) (GFile *file,
  469. GAsyncResult *result,
  470. GError **error);
  471. void (* stop_mountable) (GFile *file,
  472. GMountUnmountFlags flags,
  473. GMountOperation *mount_operation,
  474. GCancellable *cancellable,
  475. GAsyncReadyCallback callback,
  476. gpointer user_data);
  477. gboolean (* stop_mountable_finish) (GFile *file,
  478. GAsyncResult *result,
  479. GError **error);
  480. gboolean supports_thread_contexts;
  481. void (* unmount_mountable_with_operation) (GFile *file,
  482. GMountUnmountFlags flags,
  483. GMountOperation *mount_operation,
  484. GCancellable *cancellable,
  485. GAsyncReadyCallback callback,
  486. gpointer user_data);
  487. gboolean (* unmount_mountable_with_operation_finish) (GFile *file,
  488. GAsyncResult *result,
  489. GError **error);
  490. void (* eject_mountable_with_operation) (GFile *file,
  491. GMountUnmountFlags flags,
  492. GMountOperation *mount_operation,
  493. GCancellable *cancellable,
  494. GAsyncReadyCallback callback,
  495. gpointer user_data);
  496. gboolean (* eject_mountable_with_operation_finish) (GFile *file,
  497. GAsyncResult *result,
  498. GError **error);
  499. void (* poll_mountable) (GFile *file,
  500. GCancellable *cancellable,
  501. GAsyncReadyCallback callback,
  502. gpointer user_data);
  503. gboolean (* poll_mountable_finish) (GFile *file,
  504. GAsyncResult *result,
  505. GError **error);
  506. };
  507. GType g_file_get_type (void) G_GNUC_CONST;
  508. GFile * g_file_new_for_path (const char *path);
  509. GFile * g_file_new_for_uri (const char *uri);
  510. GFile * g_file_new_for_commandline_arg (const char *arg);
  511. GFile * g_file_parse_name (const char *parse_name);
  512. GFile * g_file_dup (GFile *file);
  513. guint g_file_hash (gconstpointer file);
  514. gboolean g_file_equal (GFile *file1,
  515. GFile *file2);
  516. char * g_file_get_basename (GFile *file);
  517. char * g_file_get_path (GFile *file);
  518. char * g_file_get_uri (GFile *file);
  519. char * g_file_get_parse_name (GFile *file);
  520. GFile * g_file_get_parent (GFile *file);
  521. gboolean g_file_has_parent (GFile *file,
  522. GFile *parent);
  523. GFile * g_file_get_child (GFile *file,
  524. const char *name);
  525. GFile * g_file_get_child_for_display_name (GFile *file,
  526. const char *display_name,
  527. GError **error);
  528. gboolean g_file_has_prefix (GFile *file,
  529. GFile *prefix);
  530. char * g_file_get_relative_path (GFile *parent,
  531. GFile *descendant);
  532. GFile * g_file_resolve_relative_path (GFile *file,
  533. const char *relative_path);
  534. gboolean g_file_is_native (GFile *file);
  535. gboolean g_file_has_uri_scheme (GFile *file,
  536. const char *uri_scheme);
  537. char * g_file_get_uri_scheme (GFile *file);
  538. GFileInputStream * g_file_read (GFile *file,
  539. GCancellable *cancellable,
  540. GError **error);
  541. void g_file_read_async (GFile *file,
  542. int io_priority,
  543. GCancellable *cancellable,
  544. GAsyncReadyCallback callback,
  545. gpointer user_data);
  546. GFileInputStream * g_file_read_finish (GFile *file,
  547. GAsyncResult *res,
  548. GError **error);
  549. GFileOutputStream * g_file_append_to (GFile *file,
  550. GFileCreateFlags flags,
  551. GCancellable *cancellable,
  552. GError **error);
  553. GFileOutputStream * g_file_create (GFile *file,
  554. GFileCreateFlags flags,
  555. GCancellable *cancellable,
  556. GError **error);
  557. GFileOutputStream * g_file_replace (GFile *file,
  558. const char *etag,
  559. gboolean make_backup,
  560. GFileCreateFlags flags,
  561. GCancellable *cancellable,
  562. GError **error);
  563. void g_file_append_to_async (GFile *file,
  564. GFileCreateFlags flags,
  565. int io_priority,
  566. GCancellable *cancellable,
  567. GAsyncReadyCallback callback,
  568. gpointer user_data);
  569. GFileOutputStream * g_file_append_to_finish (GFile *file,
  570. GAsyncResult *res,
  571. GError **error);
  572. void g_file_create_async (GFile *file,
  573. GFileCreateFlags flags,
  574. int io_priority,
  575. GCancellable *cancellable,
  576. GAsyncReadyCallback callback,
  577. gpointer user_data);
  578. GFileOutputStream * g_file_create_finish (GFile *file,
  579. GAsyncResult *res,
  580. GError **error);
  581. void g_file_replace_async (GFile *file,
  582. const char *etag,
  583. gboolean make_backup,
  584. GFileCreateFlags flags,
  585. int io_priority,
  586. GCancellable *cancellable,
  587. GAsyncReadyCallback callback,
  588. gpointer user_data);
  589. GFileOutputStream * g_file_replace_finish (GFile *file,
  590. GAsyncResult *res,
  591. GError **error);
  592. GFileIOStream * g_file_open_readwrite (GFile *file,
  593. GCancellable *cancellable,
  594. GError **error);
  595. void g_file_open_readwrite_async (GFile *file,
  596. int io_priority,
  597. GCancellable *cancellable,
  598. GAsyncReadyCallback callback,
  599. gpointer user_data);
  600. GFileIOStream * g_file_open_readwrite_finish (GFile *file,
  601. GAsyncResult *res,
  602. GError **error);
  603. GFileIOStream * g_file_create_readwrite (GFile *file,
  604. GFileCreateFlags flags,
  605. GCancellable *cancellable,
  606. GError **error);
  607. void g_file_create_readwrite_async (GFile *file,
  608. GFileCreateFlags flags,
  609. int io_priority,
  610. GCancellable *cancellable,
  611. GAsyncReadyCallback callback,
  612. gpointer user_data);
  613. GFileIOStream * g_file_create_readwrite_finish (GFile *file,
  614. GAsyncResult *res,
  615. GError **error);
  616. GFileIOStream * g_file_replace_readwrite (GFile *file,
  617. const char *etag,
  618. gboolean make_backup,
  619. GFileCreateFlags flags,
  620. GCancellable *cancellable,
  621. GError **error);
  622. void g_file_replace_readwrite_async (GFile *file,
  623. const char *etag,
  624. gboolean make_backup,
  625. GFileCreateFlags flags,
  626. int io_priority,
  627. GCancellable *cancellable,
  628. GAsyncReadyCallback callback,
  629. gpointer user_data);
  630. GFileIOStream * g_file_replace_readwrite_finish (GFile *file,
  631. GAsyncResult *res,
  632. GError **error);
  633. gboolean g_file_query_exists (GFile *file,
  634. GCancellable *cancellable);
  635. GFileType g_file_query_file_type (GFile *file,
  636. GFileQueryInfoFlags flags,
  637. GCancellable *cancellable);
  638. GFileInfo * g_file_query_info (GFile *file,
  639. const char *attributes,
  640. GFileQueryInfoFlags flags,
  641. GCancellable *cancellable,
  642. GError **error);
  643. void g_file_query_info_async (GFile *file,
  644. const char *attributes,
  645. GFileQueryInfoFlags flags,
  646. int io_priority,
  647. GCancellable *cancellable,
  648. GAsyncReadyCallback callback,
  649. gpointer user_data);
  650. GFileInfo * g_file_query_info_finish (GFile *file,
  651. GAsyncResult *res,
  652. GError **error);
  653. GFileInfo * g_file_query_filesystem_info (GFile *file,
  654. const char *attributes,
  655. GCancellable *cancellable,
  656. GError **error);
  657. void g_file_query_filesystem_info_async (GFile *file,
  658. const char *attributes,
  659. int io_priority,
  660. GCancellable *cancellable,
  661. GAsyncReadyCallback callback,
  662. gpointer user_data);
  663. GFileInfo * g_file_query_filesystem_info_finish (GFile *file,
  664. GAsyncResult *res,
  665. GError **error);
  666. GMount * g_file_find_enclosing_mount (GFile *file,
  667. GCancellable *cancellable,
  668. GError **error);
  669. void g_file_find_enclosing_mount_async (GFile *file,
  670. int io_priority,
  671. GCancellable *cancellable,
  672. GAsyncReadyCallback callback,
  673. gpointer user_data);
  674. GMount * g_file_find_enclosing_mount_finish (GFile *file,
  675. GAsyncResult *res,
  676. GError **error);
  677. GFileEnumerator * g_file_enumerate_children (GFile *file,
  678. const char *attributes,
  679. GFileQueryInfoFlags flags,
  680. GCancellable *cancellable,
  681. GError **error);
  682. void g_file_enumerate_children_async (GFile *file,
  683. const char *attributes,
  684. GFileQueryInfoFlags flags,
  685. int io_priority,
  686. GCancellable *cancellable,
  687. GAsyncReadyCallback callback,
  688. gpointer user_data);
  689. GFileEnumerator * g_file_enumerate_children_finish (GFile *file,
  690. GAsyncResult *res,
  691. GError **error);
  692. GFile * g_file_set_display_name (GFile *file,
  693. const char *display_name,
  694. GCancellable *cancellable,
  695. GError **error);
  696. void g_file_set_display_name_async (GFile *file,
  697. const char *display_name,
  698. int io_priority,
  699. GCancellable *cancellable,
  700. GAsyncReadyCallback callback,
  701. gpointer user_data);
  702. GFile * g_file_set_display_name_finish (GFile *file,
  703. GAsyncResult *res,
  704. GError **error);
  705. gboolean g_file_delete (GFile *file,
  706. GCancellable *cancellable,
  707. GError **error);
  708. gboolean g_file_trash (GFile *file,
  709. GCancellable *cancellable,
  710. GError **error);
  711. gboolean g_file_copy (GFile *source,
  712. GFile *destination,
  713. GFileCopyFlags flags,
  714. GCancellable *cancellable,
  715. GFileProgressCallback progress_callback,
  716. gpointer progress_callback_data,
  717. GError **error);
  718. void g_file_copy_async (GFile *source,
  719. GFile *destination,
  720. GFileCopyFlags flags,
  721. int io_priority,
  722. GCancellable *cancellable,
  723. GFileProgressCallback progress_callback,
  724. gpointer progress_callback_data,
  725. GAsyncReadyCallback callback,
  726. gpointer user_data);
  727. gboolean g_file_copy_finish (GFile *file,
  728. GAsyncResult *res,
  729. GError **error);
  730. gboolean g_file_move (GFile *source,
  731. GFile *destination,
  732. GFileCopyFlags flags,
  733. GCancellable *cancellable,
  734. GFileProgressCallback progress_callback,
  735. gpointer progress_callback_data,
  736. GError **error);
  737. gboolean g_file_make_directory (GFile *file,
  738. GCancellable *cancellable,
  739. GError **error);
  740. gboolean g_file_make_directory_with_parents (GFile *file,
  741. GCancellable *cancellable,
  742. GError **error);
  743. gboolean g_file_make_symbolic_link (GFile *file,
  744. const char *symlink_value,
  745. GCancellable *cancellable,
  746. GError **error);
  747. GFileAttributeInfoList *g_file_query_settable_attributes (GFile *file,
  748. GCancellable *cancellable,
  749. GError **error);
  750. GFileAttributeInfoList *g_file_query_writable_namespaces (GFile *file,
  751. GCancellable *cancellable,
  752. GError **error);
  753. gboolean g_file_set_attribute (GFile *file,
  754. const char *attribute,
  755. GFileAttributeType type,
  756. gpointer value_p,
  757. GFileQueryInfoFlags flags,
  758. GCancellable *cancellable,
  759. GError **error);
  760. gboolean g_file_set_attributes_from_info (GFile *file,
  761. GFileInfo *info,
  762. GFileQueryInfoFlags flags,
  763. GCancellable *cancellable,
  764. GError **error);
  765. void g_file_set_attributes_async (GFile *file,
  766. GFileInfo *info,
  767. GFileQueryInfoFlags flags,
  768. int io_priority,
  769. GCancellable *cancellable,
  770. GAsyncReadyCallback callback,
  771. gpointer user_data);
  772. gboolean g_file_set_attributes_finish (GFile *file,
  773. GAsyncResult *result,
  774. GFileInfo **info,
  775. GError **error);
  776. gboolean g_file_set_attribute_string (GFile *file,
  777. const char *attribute,
  778. const char *value,
  779. GFileQueryInfoFlags flags,
  780. GCancellable *cancellable,
  781. GError **error);
  782. gboolean g_file_set_attribute_byte_string (GFile *file,
  783. const char *attribute,
  784. const char *value,
  785. GFileQueryInfoFlags flags,
  786. GCancellable *cancellable,
  787. GError **error);
  788. gboolean g_file_set_attribute_uint32 (GFile *file,
  789. const char *attribute,
  790. guint32 value,
  791. GFileQueryInfoFlags flags,
  792. GCancellable *cancellable,
  793. GError **error);
  794. gboolean g_file_set_attribute_int32 (GFile *file,
  795. const char *attribute,
  796. gint32 value,
  797. GFileQueryInfoFlags flags,
  798. GCancellable *cancellable,
  799. GError **error);
  800. gboolean g_file_set_attribute_uint64 (GFile *file,
  801. const char *attribute,
  802. guint64 value,
  803. GFileQueryInfoFlags flags,
  804. GCancellable *cancellable,
  805. GError **error);
  806. gboolean g_file_set_attribute_int64 (GFile *file,
  807. const char *attribute,
  808. gint64 value,
  809. GFileQueryInfoFlags flags,
  810. GCancellable *cancellable,
  811. GError **error);
  812. void g_file_mount_enclosing_volume (GFile *location,
  813. GMountMountFlags flags,
  814. GMountOperation *mount_operation,
  815. GCancellable *cancellable,
  816. GAsyncReadyCallback callback,
  817. gpointer user_data);
  818. gboolean g_file_mount_enclosing_volume_finish (GFile *location,
  819. GAsyncResult *result,
  820. GError **error);
  821. void g_file_mount_mountable (GFile *file,
  822. GMountMountFlags flags,
  823. GMountOperation *mount_operation,
  824. GCancellable *cancellable,
  825. GAsyncReadyCallback callback,
  826. gpointer user_data);
  827. GFile * g_file_mount_mountable_finish (GFile *file,
  828. GAsyncResult *result,
  829. GError **error);
  830. #ifndef G_DISABLE_DEPRECATED
  831. void g_file_unmount_mountable (GFile *file,
  832. GMountUnmountFlags flags,
  833. GCancellable *cancellable,
  834. GAsyncReadyCallback callback,
  835. gpointer user_data);
  836. gboolean g_file_unmount_mountable_finish (GFile *file,
  837. GAsyncResult *result,
  838. GError **error);
  839. #endif
  840. void g_file_unmount_mountable_with_operation (GFile *file,
  841. GMountUnmountFlags flags,
  842. GMountOperation *mount_operation,
  843. GCancellable *cancellable,
  844. GAsyncReadyCallback callback,
  845. gpointer user_data);
  846. gboolean g_file_unmount_mountable_with_operation_finish (GFile *file,
  847. GAsyncResult *result,
  848. GError **error);
  849. #ifndef G_DISABLE_DEPRECATED
  850. void g_file_eject_mountable (GFile *file,
  851. GMountUnmountFlags flags,
  852. GCancellable *cancellable,
  853. GAsyncReadyCallback callback,
  854. gpointer user_data);
  855. gboolean g_file_eject_mountable_finish (GFile *file,
  856. GAsyncResult *result,
  857. GError **error);
  858. #endif
  859. void g_file_eject_mountable_with_operation (GFile *file,
  860. GMountUnmountFlags flags,
  861. GMountOperation *mount_operation,
  862. GCancellable *cancellable,
  863. GAsyncReadyCallback callback,
  864. gpointer user_data);
  865. gboolean g_file_eject_mountable_with_operation_finish (GFile *file,
  866. GAsyncResult *result,
  867. GError **error);
  868. gboolean g_file_copy_attributes (GFile *source,
  869. GFile *destination,
  870. GFileCopyFlags flags,
  871. GCancellable *cancellable,
  872. GError **error);
  873. GFileMonitor* g_file_monitor_directory (GFile *file,
  874. GFileMonitorFlags flags,
  875. GCancellable *cancellable,
  876. GError **error);
  877. GFileMonitor* g_file_monitor_file (GFile *file,
  878. GFileMonitorFlags flags,
  879. GCancellable *cancellable,
  880. GError **error);
  881. GFileMonitor* g_file_monitor (GFile *file,
  882. GFileMonitorFlags flags,
  883. GCancellable *cancellable,
  884. GError **error);
  885. void g_file_start_mountable (GFile *file,
  886. GDriveStartFlags flags,
  887. GMountOperation *start_operation,
  888. GCancellable *cancellable,
  889. GAsyncReadyCallback callback,
  890. gpointer user_data);
  891. gboolean g_file_start_mountable_finish (GFile *file,
  892. GAsyncResult *result,
  893. GError **error);
  894. void g_file_stop_mountable (GFile *file,
  895. GMountUnmountFlags flags,
  896. GMountOperation *mount_operation,
  897. GCancellable *cancellable,
  898. GAsyncReadyCallback callback,
  899. gpointer user_data);
  900. gboolean g_file_stop_mountable_finish (GFile *file,
  901. GAsyncResult *result,
  902. GError **error);
  903. void g_file_poll_mountable (GFile *file,
  904. GCancellable *cancellable,
  905. GAsyncReadyCallback callback,
  906. gpointer user_data);
  907. gboolean g_file_poll_mountable_finish (GFile *file,
  908. GAsyncResult *result,
  909. GError **error);
  910. /* Utilities */
  911. GAppInfo *g_file_query_default_handler (GFile *file,
  912. GCancellable *cancellable,
  913. GError **error);
  914. gboolean g_file_load_contents (GFile *file,
  915. GCancellable *cancellable,
  916. char **contents,
  917. gsize *length,
  918. char **etag_out,
  919. GError **error);
  920. void g_file_load_contents_async (GFile *file,
  921. GCancellable *cancellable,
  922. GAsyncReadyCallback callback,
  923. gpointer user_data);
  924. gboolean g_file_load_contents_finish (GFile *file,
  925. GAsyncResult *res,
  926. char **contents,
  927. gsize *length,
  928. char **etag_out,
  929. GError **error);
  930. void g_file_load_partial_contents_async (GFile *file,
  931. GCancellable *cancellable,
  932. GFileReadMoreCallback read_more_callback,
  933. GAsyncReadyCallback callback,
  934. gpointer user_data);
  935. gboolean g_file_load_partial_contents_finish (GFile *file,
  936. GAsyncResult *res,
  937. char **contents,
  938. gsize *length,
  939. char **etag_out,
  940. GError **error);
  941. gboolean g_file_replace_contents (GFile *file,
  942. const char *contents,
  943. gsize length,
  944. const char *etag,
  945. gboolean make_backup,
  946. GFileCreateFlags flags,
  947. char **new_etag,
  948. GCancellable *cancellable,
  949. GError **error);
  950. void g_file_replace_contents_async (GFile *file,
  951. const char *contents,
  952. gsize length,
  953. const char *etag,
  954. gboolean make_backup,
  955. GFileCreateFlags flags,
  956. GCancellable *cancellable,
  957. GAsyncReadyCallback callback,
  958. gpointer user_data);
  959. gboolean g_file_replace_contents_finish (GFile *file,
  960. GAsyncResult *res,
  961. char **new_etag,
  962. GError **error);
  963. gboolean g_file_supports_thread_contexts (GFile *file);
  964. G_END_DECLS
  965. #endif /* __G_FILE_H__ */