AgsStringUtil

AgsStringUtil — string util

Stability Level

Stable, unless otherwise indicated

Functions

Object Hierarchy

    GBoxed
    ╰── AgsStringUtil

Includes

#include <ags/lib/ags_string_util.h>

Description

Common string utility functions.

Functions

ags_string_util_escape_single_quote ()

gchar *
ags_string_util_escape_single_quote (gchar *str);

Escape all occurence of single quotes.

Parameters

str

the string to escape

 

Returns

the newly allocated string.

[transfer full]

Since: 3.0.0


ags_string_util_to_mcoded7 ()

gchar *
ags_string_util_to_mcoded7 (gchar *str);

String to mcoded7 encoding.

Parameters

str

the string to encode

 

Returns

the newly allocated string.

[transfer full]

Since: 5.5.0


ags_string_util_from_mcoded7 ()

gchar *
ags_string_util_from_mcoded7 (gchar *mcoded7_str);

String from mcoded7 encoding.

Parameters

mcoded7_str

the string to decode

 

Returns

the newly allocated string.

[transfer full]

Since: 5.5.0


ags_strv_length ()

guint
ags_strv_length (gchar **str_array);

Count the number of non-NULL entries in the array.

Parameters

str_array

the string vector.

[element-type utf8][array zero-terminated=1][transfer none]

Returns

the length of the vector

Since: 3.0.0


ags_strv_contains ()

gboolean
ags_strv_contains (gchar **str_array,
                   gchar *str);

Check occurence of str within str_array

Parameters

str_array

the string vector.

[element-type utf8][array zero-terminated=1][transfer none]

str

the string to match

 

Returns

TRUE if found, else FALSE

Since: 3.0.0


ags_strv_index ()

gint
ags_strv_index (gchar **str_array,
                gchar *str);

Check by comparing str against str_array items.

Parameters

str_array

the string vector.

[element-type utf8][array zero-terminated=1][transfer none]

str

the string to match

 

Returns

the first matching position or -1, if not found

Since: 3.0.0


ags_strv_equal ()

gboolean
ags_strv_equal (gchar **strv1,
                gchar **strv2);

Check strv1 and strv2 to be equal. The arrays don't have to be sorted.

Parameters

strv1

the string vector

 

strv2

an other string vector

 

Returns

TRUE on success, otherwise FALSE

Since: 3.2.1