## GOString

GOString

## Functions

GOString * | go_string_ERROR ()
int | go_string_cmp ()
int | go_string_cmp_ignorecase ()
gboolean | go_string_equal ()
gboolean | go_string_equal_ignorecase ()
gboolean | go_string_equal_rich ()
void | go_string_foreach_base ()
char const * | go_string_get_casefold ()
char const * | go_string_get_casefolded_collate ()
char const * | go_string_get_collation ()
guint32 | go_string_get_len ()
PangoAttrList * | go_string_get_markup ()
GOStringPhonetic * | go_string_get_phonetic ()
unsigned int | go_string_get_ref_count ()
guint32 | go_string_hash ()
GOString * | go_string_new ()
GOString * | go_string_new_len ()
GOString * | go_string_new_nocopy ()
GOString * | go_string_new_nocopy_len ()
GOString * | go_string_new_rich ()
GOString * | go_string_new_rich_nocopy ()
GOString * | go_string_ref ()
GOString * | go_string_trim ()
void | go_string_unref ()

## Types and Values

| GOString
| GOStringPhonetic

## Object Hierarchy

        GBoxed
        ╰── GOString

## Description

## Functions

### go_string_ERROR ()

    GOString *
    go_string_ERROR (void);

A convenience for g_return_val to share one error string without adding a reference to functions that do not add references to the result

#### Returns

A string saying 'ERROR'.

[transfer none]

### go_string_cmp ()

    int
    go_string_cmp (gconstpointer gstr_a,
                   gconstpointer gstr_b);

### go_string_cmp_ignorecase ()

    int
    go_string_cmp_ignorecase (gconstpointer gstr_a,
                              gconstpointer gstr_b);

### go_string_equal ()

    gboolean
    go_string_equal (gconstpointer gstr_a,
                     gconstpointer gstr_b);

### go_string_equal_ignorecase ()

    gboolean
    go_string_equal_ignorecase (gconstpointer gstr_a,
                                gconstpointer gstr_b);

#### Parameters

gstr_a | string. |
gstr_b | string. |

#### Returns

`TRUE` if the two strings are equal when ignoring letter case.

### go_string_equal_rich ()

    gboolean
    go_string_equal_rich (gconstpointer gstr_a,
                          gconstpointer gstr_b);

#### Parameters

gstr_a | string. |
gstr_b | string. |

### go_string_foreach_base ()

    void
    go_string_foreach_base (GHFunc callback,
                            gpointer data);

Iterates through the strings data base and apply `callback` to each.

#### Parameters

callback | callback. | [scope call]
data | user data |

### go_string_get_casefold ()

    char const	 *
    go_string_get_casefold (GOString const *gstr);

### go_string_get_casefolded_collate ()

    char const       *
    go_string_get_casefolded_collate (GOString const *gstr);

### go_string_get_collation ()

    char const	 *
    go_string_get_collation (GOString const *gstr);

### go_string_get_len ()

    guint32
    go_string_get_len (GOString const *gstr);

#### Parameters

gstr | string. |

### go_string_get_markup ()

    PangoAttrList *
    go_string_get_markup (GOString const *gstr);

#### Parameters

gstr | string. |

#### Returns

markup from `gstr` .

[transfer none][nullable]

### go_string_get_phonetic ()

    GOStringPhonetic *
    go_string_get_phonetic (GOString const *gstr);

[skip]

#### Parameters

gstr | GOString. |

#### Returns

the phonetic data.

[transfer none][nullable]

### go_string_get_ref_count ()

    unsigned int
    go_string_get_ref_count (GOString const *gstr);

### go_string_hash ()

    guint32
    go_string_hash (gconstpointer gstr);

### go_string_new ()

    GOString *
    go_string_new (char const *str);

GOString duplicates `str` if no string already exists.

#### Parameters

str (nullable) | string |

#### Returns

a GOString containing `str` , or `NULL` if `str` is `NULL`.

[transfer full][nullable]

### go_string_new_len ()

    GOString *
    go_string_new_len (char const *str,
                       guint32 len);

GOString duplicates `str` if no string already exists.

#### Parameters

str | string. | [nullable]
len | guint32 |

#### Returns

a GOString containing `str` , or `NULL` if `str` is `NULL`.

[transfer full][nullable]

### go_string_new_nocopy ()

    GOString *
    go_string_new_nocopy (char *str);

GOString takes ownership of `str`

#### Parameters

str | string. | [nullable]

#### Returns

a GOString containing `str` , or `NULL` if `str` is `NULL`.

[transfer full][nullable]

### go_string_new_nocopy_len ()

    GOString *
    go_string_new_nocopy_len (char *str,
                              guint32 len);

GOString takes ownership of `str`

#### Parameters

str | string. | [transfer full][nullable]
len | guint32 |

#### Returns

a GOString containing `str` .

[transfer full][nullable]

### go_string_new_rich ()

    GOString *
    go_string_new_rich (char const *str,
                        int byte_len,
                        PangoAttrList *markup,
                        GOStringPhonetic *phonetic);

#### Parameters

str (nullable) | string. |
byte_len | < 0 will call strlen. |
markup | optional markup. | [transfer full][nullable]
phonetic | optional list of phonetic extensions. | [transfer full][nullable]

#### Returns

a string.

[transfer full]

### go_string_new_rich_nocopy ()

    GOString *
    go_string_new_rich_nocopy (char *str,
                               int byte_len,
                               PangoAttrList *markup,
                               GOStringPhonetic *phonetic);

#### Parameters

str (transfer full) (nullable) | string |
byte_len | < 0 will call strlen. |
markup | optional markup. | [transfer full][nullable]
phonetic | optional list of phonetic extensions. | [transfer full][nullable]

#### Returns

a string.

[transfer full]

### go_string_ref ()

    GOString *
    go_string_ref (GOString *gstr);

### go_string_trim ()

    GOString *
    go_string_trim (GOString *gstr,
                    gboolean internal);

#### Parameters

gstr | string. |
internal | Trim multiple consequtive internal spaces. |

#### Returns

`gstr` .

[transfer none]

### go_string_unref ()

    void
    go_string_unref (GOString *gstr);

## Types and Values

### GOString

    typedef struct {
    	char const *str; /* utf-8 */
    	/* <private data> */
    } GOString;

GOString is a structure containing a string.

#### Members

char const *`str`; | the embeded UTF-8 string |

### GOStringPhonetic

    typedef struct _GOStringPhonetic GOStringPhonetic;