## GtkStringSorter GtkStringSorter — Sort by comparing strings |

## Functions

GtkStringSorter * | gtk_string_sorter_new ()
GtkExpression * | gtk_string_sorter_get_expression ()
void | gtk_string_sorter_set_expression ()
gboolean | gtk_string_sorter_get_ignore_case ()
void | gtk_string_sorter_set_ignore_case ()

## Properties

GtkExpression * | expression | Read / Write
gboolean | ignore-case | Read / Write

## Types and Values

| GtkStringSorter

## Object Hierarchy

        GObject
        ╰── GtkSorter
            ╰── GtkStringSorter

## Includes

    #include <gtk/gtk.h>

## Description

GtkStringSorter is a GtkSorter that compares strings. It does the comparison in a linguistically correct way using the current locale by normalizing Unicode strings and possibly case-folding them before performing the comparison.

To obtain the strings to compare, this sorter evaluates a GtkExpression.

## Functions

### gtk_string_sorter_new ()

    GtkStringSorter *
    gtk_string_sorter_new (GtkExpression *expression);

Creates a new string sorter that compares items using the given `expression` .

Unless an expression is set on it, this sorter will always compare items as invalid.

#### Parameters

expression | The expression to evaluate. | [transfer full][nullable]

#### Returns

a new GtkStringSorter

### gtk_string_sorter_get_expression ()

    GtkExpression *
    gtk_string_sorter_get_expression (GtkStringSorter *self);

Gets the expression that is evaluated to obtain strings from items.

#### Parameters

self | a GtkStringSorter |

#### Returns

a GtkExpression, or `NULL`.

[transfer none][nullable]

### gtk_string_sorter_set_expression ()

    void
    gtk_string_sorter_set_expression (GtkStringSorter *self,
                                      GtkExpression *expression);

Sets the expression that is evaluated to obtain strings from items.

The expression must have the type G_TYPE_STRING.

#### Parameters

self | a GtkStringSorter |
expression | a GtkExpression, or `NULL`. | [nullable][transfer none]

### gtk_string_sorter_get_ignore_case ()

    gboolean
    gtk_string_sorter_get_ignore_case (GtkStringSorter *self);

Gets whether the sorter ignores case differences.

#### Parameters

self | a GtkStringSorter |

#### Returns

`TRUE` if `self` is ignoring case differences

### gtk_string_sorter_set_ignore_case ()

    void
    gtk_string_sorter_set_ignore_case (GtkStringSorter *self,
                                       gboolean ignore_case);

Sets whether the sorter will ignore case differences.

#### Parameters

self | a GtkStringSorter |
ignore_case | `TRUE` to ignore case differences |

## Types and Values

### GtkStringSorter

    typedef struct _GtkStringSorter GtkStringSorter;

## Property Details

### The `“expression”` property

      “expression”               GtkExpression *

The expression to evaluate on item to get a string to compare with

[type GtkExpression]

Owner: GtkStringSorter

Flags: Read / Write

### The `“ignore-case”` property

      “ignore-case”              gboolean

If matching is case sensitive

Owner: GtkStringSorter

Flags: Read / Write

Default value: TRUE

## See Also

GtkExpression