camel-string-utils

camel-string-utils

Functions

Description

Functions

camel_strcase_equal ()

gint
camel_strcase_equal (gconstpointer a,
                     gconstpointer b);

camel_strcase_hash ()

guint
camel_strcase_hash (gconstpointer v);

camel_strstrcase ()

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

camel_strdown ()

const gchar *
camel_strdown (gchar *str);

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().

Parameters

string

string to add to the string pool.

[nullable]

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 .

[nullable]


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().

Parameters

string

string to copy.

[nullable]

Returns

a canonicalized copy of string .

[nullable]


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.

Parameters

string

string to free.

[nullable]

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.

Parameters

string

string to fetch from the string pool.

[nullable]

Returns

a canonicalized copy of string .

[nullable]

Since: 2.24


camel_pstring_contains ()

gboolean
camel_pstring_contains (const gchar *string);

Returns whether the string exists in the string pool.

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

Parameters

string

string to look up in the string pool.

[nullable]

Returns

Whether the string exists in the string pool

Since: 3.22


camel_pstring_dump_stat ()

void
camel_pstring_dump_stat (void);

Dumps to stdout memory statistic about the string pool.

Since: 3.6


camel_string_is_all_ascii ()

gboolean
camel_string_is_all_ascii (const gchar *str);

Parameters

str

a string to check, or NULL.

[nullable]

Returns

TRUE, when the str is NULL, an empty string or when it contains only ASCII letters.

Since: 3.44