Gjsify LogoGjsify Logo

An opaque object used for locale specific string comparisons and sort ordering.

record

Hierarchy

  • Collator

Index

Constructors

  • Creates a new #ECollator for the given locale, the returned collator should be freed with e_collator_unref().

    Parameters

    • locale: string

      The locale under which to sort

    Returns Collator

Properties

name: string

Methods

  • collate(strA: string, strB: string): [boolean, number]
  • Compares str_a with str_b, the order of strings is determined by the parameters of collator.

    The result will be set to integer less than, equal to, or greater than zero if str_a is found, respectively, to be less than, to match, or be greater than str_b.

    Either str_a or str_b can be %NULL, %NULL strings are considered to sort below other strings.

    This function will first ensure that both strings are valid UTF-8.

    Parameters

    • strA: string

      A string to compare

    • strB: string

      The string to compare with str_a

    Returns [boolean, number]

  • generateKey(str: string): string
  • Generates a collation key for str, the result of comparing two collation keys with strcmp() will be the same result of calling e_collator_collate() on the same original strings.

    This function will first ensure that str is valid UTF-8 encoded.

    Parameters

    • str: string

      The string to generate a collation key for

    Returns string

  • generateKeyForIndex(index: number): string
  • Generates a sort key for the given alphabetic index.

    The generated sort key is guaranteed to sort below any sort keys for words beginning with any variant of the given letter.

    For instance, a sort key generated for the index 5 of a latin alphabet, where the fifth index is 'E' will sort below any sort keys generated for words starting with the characters 'e', 'E', 'é', 'É', 'è' or 'È'. It will also sort above any sort keys generated for words starting with the characters 'd' or 'D'.

    Parameters

    • index: number

      An index into the alphabetic labels

    Returns string

  • getIndex(str: string): number
  • Checks which index, as determined by e_collator_get_index_labels(), that str should sort under.

    Parameters

    • str: string

      A string

    Returns number

  • getIndexLabels(): [string[], number, number, number, number]
  • Fetches the displayable labels and index positions for the active alphabet.

    Returns [string[], number, number, number, number]

  • unref(): void
  • Decreases the reference count of collator. If the reference count reaches 0 then the collator is freed

    Returns void

  • errorQuark(): number
  • Creates a new #ECollator for the given locale, the returned collator should be freed with e_collator_unref().

    Parameters

    • locale: string

      The locale under which to sort

    Returns Collator

  • newInterpretCountry(locale: string): Collator
  • Creates a new #ECollator for the given locale, the returned collator should be freed with e_collator_unref().

    In addition, this also reliably interprets the country code from the locale string and stores it to country_code.

    Parameters

    • locale: string

      The locale under which to sort

    Returns Collator

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method