ide-glib

ide-glib

Functions

Description

Functions

ide_gettext ()

const gchar *
ide_gettext (const gchar *message);

ide_g_task_return_boolean_from_main ()

void
ide_g_task_return_boolean_from_main (GTask *task,
                                     gboolean value);

This is just like g_task_return_boolean() except that it enforces that the current stack return to the main context before dispatching the callback.


ide_g_task_return_int_from_main ()

void
ide_g_task_return_int_from_main (GTask *task,
                                 gint value);

ide_g_task_return_pointer_from_main ()

void
ide_g_task_return_pointer_from_main (GTask *task,
                                     gpointer value,
                                     GDestroyNotify notify);

ide_g_task_return_error_from_main ()

void
ide_g_task_return_error_from_main (GTask *task,
                                   GError *error);

Like g_task_return_error() but ensures we return to the main loop before dispatching the result.

Parameters

task

a GTask

 

error

a GError.

[transfer full]

ide_g_file_get_uncanonical_relative_path ()

gchar *
ide_g_file_get_uncanonical_relative_path
                               (GFile *file,
                                GFile *other);

This function is similar to g_file_get_relative_path() except that file and other only need to have a shared common ancestor.

This is useful if you must use a relative path instead of the absolute, canonical path.

This is being implemented for use when communicating to GDB. When that becomes unnecessary, this should no longer be used.

Parameters

file

a GFile

 

other

a GFile with a common ancestor to file

 

Returns

A relative path, or NULL if no common ancestor was found for the relative path.

[nullable]

Since: 3.28


ide_g_file_find_async ()

void
ide_g_file_find_async (GFile *file,
                       const gchar *pattern,
                       GCancellable *cancellable,
                       GAsyncReadyCallback callback,
                       gpointer user_data);

Searches descendants of file for files matching pattern .

You may only match on the filename, not the directory.

Parameters

file

a IdeGlib

 

pattern

the glob pattern to search for using GPatternSpec

 

cancellable

a GCancellable or NULL.

[nullable]

callback

a callback to execute upon completion

 

user_data

closure data for callback

 

Since: 3.28


ide_g_file_find_finish ()

GPtrArray *
ide_g_file_find_finish (GFile *file,
                        GAsyncResult *result,
                        GError **error);

Gets the files that were found which matched the pattern.

Parameters

file

a GFile

 

result

a result provided to callback

 

error

a location for a GError or NULL

 

Returns

A GPtrArray of GFile.

[transfer container][element-type Gio.File]


ide_g_file_get_children_async ()

void
ide_g_file_get_children_async (GFile *file,
                               const gchar *attributes,
                               GFileQueryInfoFlags flags,
                               gint io_priority,
                               GCancellable *cancellable,
                               GAsyncReadyCallback callback,
                               gpointer user_data);

This function is like g_file_enumerate_children_async() except that it returns a GPtrArray of GFileInfo instead of an enumerator.

This can be convenient when you know you need all of the GFileInfo accessable at once, or the size will be small.

Parameters

file

a IdeGlib

 

attributes

attributes to retrieve

 

flags

flags for the query

 

io_priority

the io priority

 

cancellable

a GCancellable or NULL.

[nullable]

callback

a callback to execute upon completion

 

user_data

closure data for callback

 

Since: 3.28


ide_g_file_get_children_finish ()

GPtrArray *
ide_g_file_get_children_finish (GFile *file,
                                GAsyncResult *result,
                                GError **error);

Completes an asynchronous request to ide_g_file_get_children_async().

Parameters

file

a GFile

 

result

a GAsyncResult provided to callback

 

error

a location for a GError, or NULL

 

Returns

A GPtrArray of GFileInfo if successful, otherwise NULL.

[transfer container][element-type Gio.File]

Since: 3.28


ide_g_host_file_get_contents ()

gboolean
ide_g_host_file_get_contents (const gchar *path,
                              gchar **contents,
                              gsize *len,
                              GError **error);

This is similar to g_get_file_contents() but ensures that we get the file from the host, rather than our mount namespace.

Parameters

path

the path on the host

 

contents

a location for the contents.

[out]

len

a location for the size, not including trailing \0.

[out]

error

location for a GError, or NULL

 

Returns

TRUE if successful; otherwise FALSE and error is set.

Since: 3.28

Types and Values