## camel-string-utils

camel-string-utils

## Synopsis

    gint                camel_strcase_equal                 (gconstpointer a,
                                                             gconstpointer b);
    guint               camel_strcase_hash                  (gconstpointer v);
    void                camel_string_list_free              (GList *string_list);
    gchar *             camel_strstrcase                    (const gchar *haystack,
                                                             const gchar *needle);
    const gchar *       camel_strdown                       (gchar *str);
    gchar               camel_tolower                       (gchar c);
    gchar               camel_toupper                       (gchar c);
    const gchar *       camel_pstring_add                   (gchar *string,
                                                             gboolean own);
    const gchar *       camel_pstring_strdup                (const gchar *string);
    void                camel_pstring_free                  (const gchar *string);
    const gchar *       camel_pstring_peek                  (const gchar *string);
    void                camel_pstring_dump_stat             (void);

## Description

## Details

### camel_strcase_equal ()

    gint                camel_strcase_equal                 (gconstpointer a,
                                                             gconstpointer b);

### camel_strcase_hash ()

    guint               camel_strcase_hash                  (gconstpointer v);

### camel_string_list_free ()

    void                camel_string_list_free              (GList *string_list);

### camel_strstrcase ()

    gchar *             camel_strstrcase                    (const gchar *haystack,
                                                             const gchar *needle);

### camel_strdown ()

    const gchar *       camel_strdown                       (gchar *str);

### camel_tolower ()

    gchar               camel_tolower                       (gchar c);

ASCII to-lower function.

### camel_toupper ()

    gchar               camel_toupper                       (gchar c);

ASCII to-upper function.

### camel_pstring_add ()

    const gchar *       camel_pstring_add                   (gchar *string,
                                                             gboolean own);

Add `string` to the pool.

The `NULL` and empty strings are special cased to constant values.

Unreference the returned string with `camel_pstring_free()`.

`string` : | string to add to the string pool
`own` : | whether the string pool will own the memory pointed to by `string`, if `string` is not yet in the pool
Returns : | a canonicalized copy of `string`

### camel_pstring_strdup ()

    const gchar *       camel_pstring_strdup                (const gchar *string);

Create a new pooled string entry for `strings`. A pooled string is a table where common strings are canonicalized. They are also reference counted and freed when no longer referenced.

The `NULL` and empty strings are special cased to constant values.

Unreference the returned string with `camel_pstring_free()`.

`string` : | string to copy
Returns : | a canonicalized copy of `string`

### camel_pstring_free ()

    void                camel_pstring_free                  (const gchar *string);

Unreferences a pooled string. If the string's reference count drops to zero it will be deallocated. `NULL` and the empty string are special cased.

`string` : | string to free

### camel_pstring_peek ()

    const gchar *       camel_pstring_peek                  (const gchar *string);

Returns the canonicalized copy of `string` without increasing its reference count in the string pool. If necessary, `string` is first added to the string pool.

The `NULL` and empty strings are special cased to constant values.

`string` : | string to fetch from the string pool
Returns : | a canonicalized copy of `string`

Since 2.24

### camel_pstring_dump_stat ()

    void                camel_pstring_dump_stat             (void);

Dumps to stdout memory statistic about the string pool.

Since 3.6