package ocgtk

  1. Overview
  2. Docs
OCaml bindings for GTK 4

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1-preview2.tar.gz
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054

doc/ocgtk.gio/Ocgtk_gio/Gio/Wrappers/File_enumerator/index.html

Module Wrappers.File_enumerator

type t = [ `file_enumerator | `object_ ] Gobject.obj
val set_pending : t -> bool -> unit

Sets the file enumerator as having pending operations.

val next_files_finish : t -> [ `async_result ] Gobject.obj -> ([ `file_info | `object_ ] Gobject.obj list, GError.t) result

Finishes the asynchronous operation started with g_file_enumerator_next_files_async().

val next_file : t -> [ `cancellable | `object_ ] Gobject.obj option -> ([ `file_info | `object_ ] Gobject.obj option, GError.t) result

Returns information for the next file in the enumerated object. Will block until the information is available. The #GFileInfo returned from this function will contain attributes that match the attribute string that was passed when the #GFileEnumerator was created.

See the documentation of #GFileEnumerator for information about the order of returned files.

On error, returns %NULL and sets @error to the error. If the enumerator is at the end, %NULL will be returned and @error will be unset.

val is_closed : t -> bool

Checks if the file enumerator has been closed.

val has_pending : t -> bool

Checks if the file enumerator has pending operations.

val get_container : t -> [ `file ] Gobject.obj

Get the #GFile container which is being enumerated.

val get_child : t -> [ `file_info | `object_ ] Gobject.obj -> [ `file ] Gobject.obj

Return a new #GFile which refers to the file named by @info in the source directory of @enumerator. This function is primarily intended to be used inside loops with g_file_enumerator_next_file().

To use this, %G_FILE_ATTRIBUTE_STANDARD_NAME must have been listed in the attributes list used when creating the #GFileEnumerator.

This is a convenience method that's equivalent to: |<!-- language="C" --> gchar *name = g_file_info_get_name (info); GFile *child = g_file_get_child (g_file_enumerator_get_container (enumr), name); |

val close_finish : t -> [ `async_result ] Gobject.obj -> (bool, GError.t) result

Finishes closing a file enumerator, started from g_file_enumerator_close_async().

If the file enumerator was already closed when g_file_enumerator_close_async() was called, then this function will report %G_IO_ERROR_CLOSED in @error, and return %FALSE. If the file enumerator had pending operation when the close operation was started, then this function will report %G_IO_ERROR_PENDING, and return %FALSE. If @cancellable was not %NULL, then the operation may have been cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be returned.

val close : t -> [ `cancellable | `object_ ] Gobject.obj option -> (bool, GError.t) result

Releases all resources used by this enumerator, making the enumerator return %G_IO_ERROR_CLOSED on all calls.

This will be automatically called when the last reference is dropped, but you might want to call this function to make sure resources are released as early as possible.