LibreOffice LibreOffice 25.8 SDK C/C++ API Reference

Loading...
Searching...
No Matches
locale.h File Reference
`#include "sal/config.h"`
`#include "rtl/ustring.h"`
`#include "sal/saldllapi.h"`

Go to the source code of this file.

## Classes
struct | _rtl_Locale
| The implementation structure of a locale. More...

## Typedefs
typedef struct _rtl_Locale | rtl_Locale
| The implementation structure of a locale.

## Functions
SAL_DLLPUBLIC rtl_Locale * | rtl_locale_register (const sal_Unicode *language, const sal_Unicode *country, const sal_Unicode *variant)
| Register a locale from language, country and variant.
SAL_DLLPUBLIC rtl_Locale * | rtl_locale_getDefault (void)
| Common method of getting the current default Locale.
SAL_DLLPUBLIC void | rtl_locale_setDefault (const sal_Unicode *language, const sal_Unicode *country, const sal_Unicode *variant)
| Sets the default.
SAL_DLLPUBLIC rtl_uString * | rtl_locale_getLanguage (rtl_Locale *This)
| Getter for programmatic name of field, a lowercase two-letter ISO 639-1 or three-letter ISO 639-3 code.
SAL_DLLPUBLIC rtl_uString * | rtl_locale_getCountry (rtl_Locale *This)
| Getter for programmatic name of field, an uppercased two-letter ISO-3166 code.
SAL_DLLPUBLIC rtl_uString * | rtl_locale_getVariant (rtl_Locale *This)
| Getter for programmatic name of field.
SAL_DLLPUBLIC sal_Int32 | rtl_locale_hashCode (rtl_Locale *This)
| Returns the hash code of the locale This.
SAL_DLLPUBLIC sal_Int32 | rtl_locale_equals (rtl_Locale *This, rtl_Locale *obj)
| Returns true if the locals are equal, otherwise false.

## Typedef Documentation

## ◆ rtl_Locale

typedef struct _rtl_Locale rtl_Locale

The implementation structure of a locale.

Do not create this structure direct. Only use the functions rtl_locale_register and rtl_locale_setDefault. The strings Language, Country and Variant are constants, so it is not necessary to acquire and release them.

## Function Documentation

## ◆ rtl_locale_equals()

SAL_DLLPUBLIC sal_Int32 rtl_locale_equals | ( | rtl_Locale * | This,
|  | rtl_Locale * | obj )

Returns true if the locals are equal, otherwise false.

## ◆ rtl_locale_getCountry()

SAL_DLLPUBLIC rtl_uString * rtl_locale_getCountry | ( | rtl_Locale * | This | ) |

Getter for programmatic name of field, an uppercased two-letter ISO-3166 code.

See also
  getDisplayCountry

## ◆ rtl_locale_getDefault()

SAL_DLLPUBLIC rtl_Locale * rtl_locale_getDefault | ( | void |  | ) |

Common method of getting the current default Locale.

Deprecated
  LibreOffice itself does not use this anymore, and client code should not have good use for it either. It may eventually be removed.

## ◆ rtl_locale_getLanguage()

SAL_DLLPUBLIC rtl_uString * rtl_locale_getLanguage | ( | rtl_Locale * | This | ) |

Getter for programmatic name of field, a lowercase two-letter ISO 639-1 or three-letter ISO 639-3 code.

See also
  getDisplayLanguage

## ◆ rtl_locale_getVariant()

SAL_DLLPUBLIC rtl_uString * rtl_locale_getVariant | ( | rtl_Locale * | This | ) |

Getter for programmatic name of field.

See also
  getDisplayVariant

## ◆ rtl_locale_hashCode()

SAL_DLLPUBLIC sal_Int32 rtl_locale_hashCode | ( | rtl_Locale * | This | ) |

Returns the hash code of the locale This.

## ◆ rtl_locale_register()

SAL_DLLPUBLIC rtl_Locale * rtl_locale_register | ( | const sal_Unicode * | language,
|  | const sal_Unicode * | country,
|  | const sal_Unicode * | variant )

Register a locale from language, country and variant.

Parameters

  language | lowercase two-letter ISO 639-1 or three-letter ISO 639-3 code.
  country | uppercase two-letter ISO-3166 code. May be null.
  variant | vendor and browser specific code. May be null.

## ◆ rtl_locale_setDefault()

SAL_DLLPUBLIC void rtl_locale_setDefault | ( | const sal_Unicode * | language,
|  | const sal_Unicode * | country,
|  | const sal_Unicode * | variant )

Sets the default.

`setDefault` does not reset the host locale.

Parameters

  language | lowercase two-letter ISO 639-1 or three-letter ISO 639-3 code.
  country | uppercase two-letter ISO-3166 code.
  variant | vendor and browser specific code. See class description.

Deprecated
  LibreOffice itself does not use this anymore, and client code should not have good use for it either. It may eventually be removed.