W Wrapl, The Programming Language

Libraries:Gtk:Gio:GFileEnumerator

Types

T

Inherits from:

T allows you to operate on a set of Gtk.Gio.GFile.Ts, returning a Gtk.Gio.GFileInfo.T structure for each file enumerated (e.g. Gtk.Gio.GFile.EnumerateChildren will return a T for each of the children within a directory).

To get the next file's information from a T, use NextFile or its asynchronous version, NextFilesAsync. Note that the asynchronous version will return a list of Gtk.Gio.GFileInfo.Ts, whereas the synchronous will only return the next file in the enumerator.

To close a T, use Close, or its asynchronous version, CloseAsync. Once a T is closed, no further actions may be performed on it, and it should be freed with g_object_unref().



Constants

Nil : T

Functions

GetType() : Gtk.GObject.Type.T



Methods

:Close(self @ T, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Std.Symbol.T

Releases all resources used by this enumerator, making the enumerator return Gtk.Gio.GIOErrorEnum.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.

enumerator a T.
cancellable optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none]
error location to store the error occurring, or NULL to ignore
Returns TRUE on success or FALSE on error.


:CloseAsync(self @ T, io_priority @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T

Asynchronously closes the file enumerator.

If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error Gtk.Gio.GIOErrorEnum.Cancelled will be returned in CloseFinish.

enumerator a T.
io_priority the I/O priority of the request.
cancellable optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none]
callback a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied. [scope async]
user_data the data to pass to callback function. [closure]


:CloseFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Symbol.T

Finishes closing a file enumerator, started from CloseAsync.

If the file enumerator was already closed when CloseAsync was called, then this function will report Gtk.Gio.GIOErrorEnum.Closed in error, and return FALSE. If the file enumerator had pending operation when the close operation was started, then this function will report Gtk.Gio.GIOErrorEnum.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 Gtk.Gio.GIOErrorEnum.Cancelled will be set, and FALSE will be returned.

enumerator a T.
result a Gtk.Gio.GAsyncResult.T.
error a Gtk.Glib.GError.T location to store the error occurring, or NULL to ignore.
Returns TRUE if the close operation has finished successfully.


:GetContainer(self @ T) : Gtk.Gio.GFile.T

Get the Gtk.Gio.GFile.T container which is being enumerated.

enumerator a T
Returns the Gtk.Gio.GFile.T which is being enumerated. [transfer none]


:HasPending(self @ T) : Std.Symbol.T

Checks if the file enumerator has pending operations.

enumerator a T.
Returns TRUE if the enumerator has pending operations.


:IsClosed(self @ T) : Std.Symbol.T

Checks if the file enumerator has been closed.

enumerator a T.
Returns TRUE if the enumerator is closed.


:NextFile(self @ T, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Gtk.Gio.GFileInfo.T

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

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.

enumerator a T.
cancellable optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none]
error location to store the error occurring, or NULL to ignore
Returns A Gtk.Gio.GFileInfo.T or NULL on error or end of enumerator. Free the returned object with g_object_unref() when no longer needed. [transfer full]


:NextFilesAsync(self @ T, num_files @ Std.Integer.SmallT, io_priority @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T

Request information for a number of files from the enumerator asynchronously. When all i/o for the operation is finished the callback will be called with the requested information.

The callback can be called with less than num_files files in case of error or at the end of the enumerator. In case of a partial error the callback will be called with any succeeding items and no error, and on the next request the error will be reported. If a request is cancelled the callback will be called with Gtk.Gio.GIOErrorEnum.Cancelled.

During an async request no other sync and async calls are allowed, and will result in Gtk.Gio.GIOErrorEnum.Pending errors.

Any outstanding i/o request with higher priority (lower numerical value) will be executed before an outstanding request with lower priority. Default priority is G_PRIORITY_DEFAULT.

enumerator a T.
num_files the number of file info objects to request
io_priority the io priority of the request.
cancellable optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none]
callback a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied. [scope async]
user_data the data to pass to callback function. [closure]


:NextFilesFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Object.T

Finishes the asynchronous operation started with NextFilesAsync.

enumerator a T.
result a Gtk.Gio.GAsyncResult.T.
error a Gtk.Glib.GError.T location to store the error occurring, or NULL to ignore.
Returns a GList of Gtk.Gio.GFileInfo.Ts. You must free the list with g_list_free() and unref the infos with g_object_unref() when you're done with them. [transfer full][element-type Gio.FileInfo]


:Priv(self @ T) : Std.Object.T

:SetPending(self @ T, pending @ Std.Symbol.T) : Std.Object.T

Sets the file enumerator as having pending operations.

enumerator a T.
pending a boolean value.


:setPriv(self @ T, value @ Std.Object.T) : Std.Object.T