LibreOffice LibreOffice 25.2 SDK API Reference

Public Member Functions | List of all members
XCollator Interface Referencepublished

provides locale-sensitive collation algorithms for string comparison. More...

`import"XCollator.idl";`

Inheritance diagram for XCollator:

## Public Member Functions
long | compareSubstring ([in] string aStr1, [in] long nOff1, [in] long nLen1, [in] string aStr2, [in] long nOff2, [in] long nLen2)
| Compare 2 substrings in specific locale and algorithm. More...
long | compareString ([in] string aStr1, [in] string aStr2)
| Compare 2 strings in specific locale and algorithm. More...
long | loadDefaultCollator ([in] ::com::sun::star::lang::Locale aLocale, [in] long nCollatorOptions)
| Load the collator with default algorithm defined in locale data. More...
long | loadCollatorAlgorithm ([in] string aAlgorithmName, [in] ::com::sun::star::lang::Locale aLocale, [in] long nCollatorOptions)
| Load a particular collator algorithm for the locale. More...
sequence< string > | listCollatorAlgorithms ([in] ::com::sun::star::lang::Locale aLocale)
| List all collator algorithms for a given locale. More...
void | loadCollatorAlgorithmWithEndUserOption ([in] string aAlgorithmName, [in] ::com::sun::star::lang::Locale aLocale, [in] sequence< long > aCollatorOptions)
| Load a collator algorithm with options chosen by end user. More...
sequence< long > | listCollatorOptions ([in] string aAlgorithmName)
| List all end user collator options for a given algorithm. More...
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object. More...
void | acquire ()
| increases the reference counter by one. More...
void | release ()
| decreases the reference counter by one. More...

## Detailed Description

provides locale-sensitive collation algorithms for string comparison.

Developers Guide
  Office Development - Implementing a New Locale - XCollator
  Office Development - Overview and Using the API - XCollator

## Member Function Documentation

## ◆ compareString()

long compareString | ( | [in] string | aStr1,
|  | [in] string | aStr2
| ) |  |

Compare 2 strings in specific locale and algorithm.

Parameters

  aStr1 | First string.
  aStr2 | Second string.

Returns
  1 if the first string is greater than the second string
  0 if the first string is equal to the second string
  -1 if the first string is less than the second string

## ◆ compareSubstring()

long compareSubstring | ( | [in] string | aStr1,
|  | [in] long | nOff1,
|  | [in] long | nLen1,
|  | [in] string | aStr2,
|  | [in] long | nOff2,
|  | [in] long | nLen2
| ) |  |

Compare 2 substrings in specific locale and algorithm.

Parameters

  aStr1 | First string.
  nOff1 | Offset (from 0) of the first string.
  nLen1 | Length (from offset) of the first substring.
  aStr2 | Second string
  nOff2 | Offset (from 0) of the second string.
  nLen2 | Length (from offset) of the second substring.

Returns
  1 if the first string is greater than the second string
  0 if the first string is equal to the second string
  -1 if the first string is less than the second string

## ◆ listCollatorAlgorithms()

sequence< string > listCollatorAlgorithms | ( | [in] ::com::sun::star::lang::Locale | aLocale | ) |

List all collator algorithms for a given locale.

Parameters

  aLocale | The locale for which to list algorithms.

Returns
  A sequence of algorithm names.

## ◆ listCollatorOptions()

sequence< long > listCollatorOptions | ( | [in] string | aAlgorithmName | ) |

List all end user collator options for a given algorithm.

Parameters

  aAlgorithmName | The algorithm name for this collator.

Returns
  An array of end user options available for the algorithm.

## ◆ loadCollatorAlgorithm()

long loadCollatorAlgorithm | ( | [in] string | aAlgorithmName,
|  | [in] ::com::sun::star::lang::Locale | aLocale,
|  | [in] long | nCollatorOptions
| ) |  |

Load a particular collator algorithm for the locale.

Parameters

  aAlgorithmName | The algorithm to load.
  aLocale | The locale for this collator.
  nCollatorOptions | A mask of CollatorOptions.

Returns
  Returns 0 when loading was successful, otherwise throws runtime exception.

## ◆ loadCollatorAlgorithmWithEndUserOption()

void loadCollatorAlgorithmWithEndUserOption | ( | [in] string | aAlgorithmName,
|  | [in] ::com::sun::star::lang::Locale | aLocale,
|  | [in] sequence< long > | aCollatorOptions
| ) |  |

Load a collator algorithm with options chosen by end user.

Parameters

  aAlgorithmName | The algorithm name to load.
  aLocale | The locale for this collator.
  aCollatorOptions | A sequence of end user collator options like those returned by XCollator::listCollatorOptions().

## ◆ loadDefaultCollator()

long loadDefaultCollator | ( | [in] ::com::sun::star::lang::Locale | aLocale,
|  | [in] long | nCollatorOptions
| ) |  |

Load the collator with default algorithm defined in locale data.

Parameters

  aLocale | The locale for this collator.
  nCollatorOptions | A mask of CollatorOptions.

Returns
  Returns 0 when loading was successful, otherwise throws runtime exception. In fact the return value should be ignored and the exception be caught instead.

The documentation for this interface was generated from the following file:

- com/sun/star/i18n/XCollator.idl