Class LibCLocale

java.lang.Object
org.lwjgl.system.libc.LibCLocale

public class LibCLocale extends Object
Native bindings to locale.h.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Selects the entire C locale.
    static final int
    Selects the collation category of the C locale.
    static final int
    Selects the character classification category of the C locale.
    static final int
    Selects the monetary formatting category of the C locale.
    static final int
    Selects the numeric formatting category of the C locale.
    static final int
    Selects the time formatting category of the C locale.
  • Method Summary

    Modifier and Type
    Method
    Description
    static long
    nsetlocale(int category, long locale)
    static @Nullable String
    setlocale(int category, CharSequence locale)
    Gets and sets the current C locale.
    static @Nullable String
    setlocale(int category, ByteBuffer locale)
    Gets and sets the current C locale.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LC_ALL

      public static final int LC_ALL
      Selects the entire C locale.
    • LC_COLLATE

      public static final int LC_COLLATE
      Selects the collation category of the C locale.
    • LC_CTYPE

      public static final int LC_CTYPE
      Selects the character classification category of the C locale.
    • LC_MONETARY

      public static final int LC_MONETARY
      Selects the monetary formatting category of the C locale.
    • LC_NUMERIC

      public static final int LC_NUMERIC
      Selects the numeric formatting category of the C locale.
    • LC_TIME

      public static final int LC_TIME
      Selects the time formatting category of the C locale.
  • Method Details

    • nsetlocale

      public static long nsetlocale(int category, long locale)
    • setlocale

      public static @Nullable String setlocale(int category, ByteBuffer locale)
      Gets and sets the current C locale.

      The setlocale function installs the specified system locale or its portion as the new C locale. The modifications remain in effect and influences the execution of all locale-sensitive C library functions until the next call to setlocale. If locale is a null pointer, setlocale queries the current C locale without modifying it.

      Parameters:
      category - the locale category identifier, may by null. One of:
      LC_ALLLC_COLLATELC_CTYPELC_MONETARYLC_NUMERICLC_TIME
      locale - system-specific locale identifier. Can be "" for the user-preferred locale or "C" for the minimal locale.
      Returns:
      a pointer to a narrow null-terminated string identifying the C locale after applying the changes, if any, or null pointer on failure.

      A copy of the returned string along with the category used in this call to setlocale may be used later in the program to restore the locale back to the state at the end of this call.

    • setlocale

      public static @Nullable String setlocale(int category, CharSequence locale)
      Gets and sets the current C locale.

      The setlocale function installs the specified system locale or its portion as the new C locale. The modifications remain in effect and influences the execution of all locale-sensitive C library functions until the next call to setlocale. If locale is a null pointer, setlocale queries the current C locale without modifying it.

      Parameters:
      category - the locale category identifier, may by null. One of:
      LC_ALLLC_COLLATELC_CTYPELC_MONETARYLC_NUMERICLC_TIME
      locale - system-specific locale identifier. Can be "" for the user-preferred locale or "C" for the minimal locale.
      Returns:
      a pointer to a narrow null-terminated string identifying the C locale after applying the changes, if any, or null pointer on failure.

      A copy of the returned string along with the category used in this call to setlocale may be used later in the program to restore the locale back to the state at the end of this call.