## gimputils

gimputils — Utilities of general interest

## Synopsis

    gchar*      gimp_utf8_strtrim               (const gchar *str,
                                                 gint max_chars);
    gchar*      gimp_memsize_to_string          (gulong memsize);
    gchar*      gimp_strip_uline                (const gchar *str);

## Description

## Details

### gimp_utf8_strtrim ()

    gchar*      gimp_utf8_strtrim               (const gchar *str,
                                                 gint max_chars);

Creates a (possibly trimmed) copy of `str`. The string is cut if it exceeds `max_chars` characters or on the first newline. The fact that the string was trimmed is indicated by appending an ellipsis.

`str` : | an UTF-8 encoded string (or `NULL`)
`max_chars` : | the maximum number of characters before the string get trimmed
Returns : | A (possibly trimmed) copy of `str` which should be freed using g_free() when it is not needed any longer.

### gimp_memsize_to_string ()

    gchar*      gimp_memsize_to_string          (gulong memsize);

This function returns a human readable, translated representation of the passed `memsize`. Large values are rounded to the closest reasonable memsize unit, e.g.: "3456" becomes "3456 Bytes", "4100" becomes "4 KB" and so on.

`memsize` : | A memory size in bytes.
Returns : | A human-readable, translated string.

### gimp_strip_uline ()

    gchar*      gimp_strip_uline                (const gchar *str);

This function returns a copy of `str` stripped of underline characters. This comes in handy when needing to strip mnemonics from menu paths etc.

`str` : | Underline infested string (or `NULL`)
Returns : | A (possibly stripped) copy of `str` which should be freed using g_free() when it is not needed any longer.