ide-glib: Builder SDK Reference

## ide-glib ide-glib |

## Functions

#define | IDE_PTR_ARRAY_CLEAR_FREE_FUNC()
#define | IDE_PTR_ARRAY_SET_FREE_FUNC()
#define | IDE_PTR_ARRAY_STEAL_FULL()
#define | ide_strv_empty0()
gboolean | ide_environ_parse ()
const gchar * | ide_gettext ()
void | ide_g_task_return_boolean_from_main ()
void | ide_g_task_return_int_from_main ()
void | ide_g_task_return_pointer_from_main ()
void | ide_g_task_return_error_from_main ()
gchar * | ide_g_file_get_uncanonical_relative_path ()
void | ide_g_file_find_with_depth_async ()
void | ide_g_file_find_async ()
GPtrArray * | ide_g_file_find_finish ()
void | ide_g_file_get_children_async ()
GPtrArray * | ide_g_file_get_children_finish ()
gboolean | ide_g_host_file_get_contents ()

## Description

## Functions

### IDE_PTR_ARRAY_CLEAR_FREE_FUNC()

    #define             IDE_PTR_ARRAY_CLEAR_FREE_FUNC(ar)

### IDE_PTR_ARRAY_SET_FREE_FUNC()

    #define             IDE_PTR_ARRAY_SET_FREE_FUNC(ar, func)

### IDE_PTR_ARRAY_STEAL_FULL()

    #define             IDE_PTR_ARRAY_STEAL_FULL(arptr)

### ide_strv_empty0()

    #define ide_strv_empty0(strv) (((strv) == NULL) || ((strv)[0] == NULL))

### ide_environ_parse ()

    gboolean
    ide_environ_parse (const gchar *pair,
                       gchar **key,
                       gchar **value);

### 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_with_depth_async ()

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

Searches descendants of `file` for files matching `pattern` .

Only up to `max_depth` subdirectories will be searched. However, if `max_depth` is zero, then all directories will be searched.

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

#### Parameters

file | a IdeGlib |
pattern | the glob pattern to search for using GPatternSpec |
max_depth | maximum tree depth to search |
cancellable | a GCancellable or `NULL`. | [nullable]
callback | a callback to execute upon completion |
user_data | closure data for `callback` |

Since: 3.30

### 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 full][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 full][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