Package org.lwjgl.sdl

Class SDL_Locale

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class SDL_Locale extends Struct<SDL_Locale> implements NativeResource

 struct SDL_Locale {
     char const * language;
     char const * country;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • LANGUAGE

      public static final int LANGUAGE
      The struct member offsets.
    • COUNTRY

      public static final int COUNTRY
      The struct member offsets.
  • Constructor Details

    • SDL_Locale

      public SDL_Locale(ByteBuffer container)
      Creates a SDL_Locale instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<SDL_Locale>
    • language

      public ByteBuffer language()
      Returns:
      a ByteBuffer view of the null-terminated string pointed to by the language field.
    • languageString

      public String languageString()
      Returns:
      the null-terminated string pointed to by the language field.
    • country

      public @Nullable ByteBuffer country()
      Returns:
      a ByteBuffer view of the null-terminated string pointed to by the country field.
    • countryString

      public @Nullable String countryString()
      Returns:
      the null-terminated string pointed to by the country field.
    • language

      public SDL_Locale language(ByteBuffer value)
      Sets the address of the specified encoded string to the language field.
    • country

      public SDL_Locale country(@Nullable ByteBuffer value)
      Sets the address of the specified encoded string to the country field.
    • set

      public SDL_Locale set(ByteBuffer language, @Nullable ByteBuffer country)
      Initializes this struct with the specified values.
    • set

      public SDL_Locale set(SDL_Locale src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static SDL_Locale malloc()
      Returns a new SDL_Locale instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static SDL_Locale calloc()
      Returns a new SDL_Locale instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static SDL_Locale create()
      Returns a new SDL_Locale instance allocated with BufferUtils.
    • create

      public static SDL_Locale create(long address)
      Returns a new SDL_Locale instance for the specified memory address.
    • createSafe

      public static @Nullable SDL_Locale createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static SDL_Locale.Buffer malloc(int capacity)
      Returns a new SDL_Locale.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static SDL_Locale.Buffer calloc(int capacity)
      Returns a new SDL_Locale.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static SDL_Locale.Buffer create(int capacity)
      Returns a new SDL_Locale.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static SDL_Locale.Buffer create(long address, int capacity)
      Create a SDL_Locale.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable SDL_Locale.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static SDL_Locale malloc(MemoryStack stack)
      Returns a new SDL_Locale instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static SDL_Locale calloc(MemoryStack stack)
      Returns a new SDL_Locale instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static SDL_Locale.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new SDL_Locale.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static SDL_Locale.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new SDL_Locale.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nlanguage

      public static ByteBuffer nlanguage(long struct)
      Unsafe version of language().
    • nlanguageString

      public static String nlanguageString(long struct)
      Unsafe version of languageString().
    • ncountry

      public static @Nullable ByteBuffer ncountry(long struct)
      Unsafe version of country().
    • ncountryString

      public static @Nullable String ncountryString(long struct)
      Unsafe version of countryString().
    • nlanguage

      public static void nlanguage(long struct, ByteBuffer value)
      Unsafe version of language.
    • ncountry

      public static void ncountry(long struct, @Nullable ByteBuffer value)
      Unsafe version of country.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate