as-utils-private 3 APPSTREAM Library
as-utils-private

## Functions

gboolean | as_utils_delete_dir_recursive ()
GPtrArray * | as_utils_categories_from_strv ()
GPtrArray * | as_utils_categories_from_str ()
GPtrArray * | as_utils_find_files_matching ()
GPtrArray * | as_utils_find_files ()
gboolean | as_utils_is_root ()
gboolean | as_utils_is_writable ()
gchar * | as_str_replace ()
gchar ** | as_ptr_array_to_strv ()
gboolean | as_touch_location ()
gboolean | as_copy_file ()
void | as_reset_umask ()
gboolean | as_is_cruft_locale ()
gchar * | as_locale_strip_encoding ()
gchar * | as_get_current_arch ()
gboolean | as_arch_compatible ()

## Description

## Functions

### as_utils_delete_dir_recursive ()

    gboolean
    as_utils_delete_dir_recursive (const gchar *dirname);

Remove directory and all its children (like rm -r does).

#### Parameters

dirname | Directory to remove |

#### Returns

`TRUE` if operation was successful

as_utils_delete_dir_recursive

### as_utils_categories_from_strv ()

    GPtrArray *
    as_utils_categories_from_strv (gchar **categories_strv,
                                   GPtrArray *system_categories);

Create a list of categories from string array

#### Parameters

categories_strv | a string array |
system_categories | list of AsCategory objects available on this system |

#### Returns

GPtrArray of AsCategory objects matching the strings in the array.

[element-type AsCategory][transfer full]

as_utils_categories_from_strv

### as_utils_categories_from_str ()

    GPtrArray *
    as_utils_categories_from_str (const gchar *categories_str,
                                  GPtrArray *system_categories);

Create a list of categories from semicolon-separated string

#### Parameters

categories_str | string with semicolon-separated categories |
system_categories | list of AsCategory objects available on this system |

#### Returns

GPtrArray of AsCategory objcts matching the strings in the array.

[element-type AsCategory][transfer full]

as_utils_categories_from_str

### as_utils_find_files_matching ()

    GPtrArray *
    as_utils_find_files_matching (const gchar *dir,
                                  const gchar *pattern,
                                  gboolean recursive,
                                  GError **error);

as_utils_find_files_matching

### as_utils_find_files ()

    GPtrArray *
    as_utils_find_files (const gchar *dir,
                         gboolean recursive,
                         GError **error);

as_utils_find_files

### as_utils_is_root ()

    gboolean
    as_utils_is_root (void);

as_utils_is_root

### as_utils_is_writable ()

    gboolean
    as_utils_is_writable (const gchar *path);

Checks if a path is writable.

#### Parameters

path | the path to check. |

as_utils_is_writable

### as_str_replace ()

    gchar *
    as_str_replace (const gchar *str,
                    const gchar *old_str,
                    const gchar *new_str);

as_str_replace

### as_ptr_array_to_strv ()

    gchar **
    as_ptr_array_to_strv (GPtrArray *array);

#### Parameters

array | . | [element-type utf8]

#### Returns

strv of the string array.

[transfer full]

as_ptr_array_to_strv

### as_touch_location ()

    gboolean
    as_touch_location (const gchar *fname);

Change mtime of a filesystem location.

#### Parameters

fname | The file or directory to touch. |

as_touch_location

### as_copy_file ()

    gboolean
    as_copy_file (const gchar *source,
                  const gchar *destination,
                  GError **error);

Copy a file.

as_copy_file

### as_reset_umask ()

    void
    as_reset_umask (void);

Reset umask potentially set by the user to a default value, so we can create files with the correct permissions.

as_reset_umask

### as_is_cruft_locale ()

    gboolean
    as_is_cruft_locale (const gchar *locale);

Checks whether the given locale is valid or a cruft or dummy locale.

as_is_cruft_locale

### as_locale_strip_encoding ()

    gchar *
    as_locale_strip_encoding (gchar *locale);

Remove the encoding from a locale string. The function modifies the string directly.

as_locale_strip_encoding

### as_get_current_arch ()

    gchar *
    as_get_current_arch (void);

Get the current architecture as vendor strings (e.g. "amd64" instead of "x86_64").

#### Returns

The current OS architecture as string.

[transfer full]

as_get_current_arch

### as_arch_compatible ()

    gboolean
    as_arch_compatible (const gchar *arch1,
                        const gchar *arch2);

Compares two architectures and returns `TRUE` if they are compatible.

#### Parameters

arch1 | Architecture 1 |
arch2 | Architecture 2 |

as_arch_compatible

## Types and Values