Package org.gnome.glib
Class OptionEntry
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.glib.OptionEntry
- All Implemented Interfaces:
Proxy
OptionArg.NONE:gbooleanOptionArg.STRING:gchar*OptionArg.INT:gintOptionArg.FILENAME:gchar*OptionArg.STRING_ARRAY:gchar**OptionArg.FILENAME_ARRAY:gchar**OptionArg.DOUBLE:gdouble
If arg type is OptionArg.STRING or OptionArg.FILENAME,
the location will contain a newly allocated string if the option
was given. That string needs to be freed by the callee using g_free().
Likewise if arg type is OptionArg.STRING_ARRAY or
OptionArg.FILENAME_ARRAY, the data should be freed using g_strfreev().
A GOptionEntry struct defines a single option. To have an effect, they
must be added to a GOptionGroup with g_option_context_add_main_entries()
or g_option_group_add_entries().
-
Constructor Summary
ConstructorsConstructorDescriptionAllocate a new OptionEntry.OptionEntry(Arena arena) Allocate a new OptionEntry.OptionEntry(MemorySegment address) Create a OptionEntry proxy instance for the provided memory address.OptionEntry(String longName, byte shortName, int flags, OptionArg arg, MemorySegment argData, String description, String argDescription) Allocate a new OptionEntry with the fields set to the provided values.OptionEntry(String longName, byte shortName, int flags, OptionArg arg, MemorySegment argData, String description, String argDescription, Arena arena) Allocate a new OptionEntry with the fields set to the provided values. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayoutThe memory layout of the native struct.readArg()Read the value of the fieldarg.Read the value of the fieldarg_data.Read the value of the fieldarg_description.Read the value of the fielddescription.intRead the value of the fieldflags.Read the value of the fieldlong_name.byteRead the value of the fieldshort_name.voidWrite a value in the fieldarg.voidwriteArgData(MemorySegment argData) Write a value in the fieldarg_data.voidwriteArgDescription(String argDescription, Arena _arena) Write a value in the fieldarg_description.voidwriteDescription(String description, Arena _arena) Write a value in the fielddescription.voidwriteFlags(int flags) Write a value in the fieldflags.voidwriteLongName(String longName, Arena _arena) Write a value in the fieldlong_name.voidwriteShortName(byte shortName) Write a value in the fieldshort_name.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
OptionEntry
Create a OptionEntry proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
OptionEntry
Allocate a new OptionEntry.- Parameters:
arena- to control the memory allocation scope
-
OptionEntry
public OptionEntry()Allocate a new OptionEntry. The memory is allocated withArena.ofAuto(). -
OptionEntry
public OptionEntry(String longName, byte shortName, int flags, OptionArg arg, MemorySegment argData, String description, String argDescription, Arena arena) Allocate a new OptionEntry with the fields set to the provided values.- Parameters:
longName- value for the fieldlongNameshortName- value for the fieldshortNameflags- value for the fieldflagsarg- value for the fieldargargData- value for the fieldargDatadescription- value for the fielddescriptionargDescription- value for the fieldargDescriptionarena- to control the memory allocation scope
-
OptionEntry
public OptionEntry(String longName, byte shortName, int flags, OptionArg arg, MemorySegment argData, String description, String argDescription) Allocate a new OptionEntry with the fields set to the provided values. The memory is allocated withArena.ofAuto().- Parameters:
longName- value for the fieldlongNameshortName- value for the fieldshortNameflags- value for the fieldflagsarg- value for the fieldargargData- value for the fieldargDatadescription- value for the fielddescriptionargDescription- value for the fieldargDescription
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readLongName
Read the value of the fieldlong_name.- Returns:
- The value of the field
long_name
-
writeLongName
-
readShortName
public byte readShortName()Read the value of the fieldshort_name.- Returns:
- The value of the field
short_name
-
writeShortName
public void writeShortName(byte shortName) Write a value in the fieldshort_name.- Parameters:
shortName- The new value for the fieldshort_name
-
readFlags
public int readFlags()Read the value of the fieldflags.- Returns:
- The value of the field
flags
-
writeFlags
public void writeFlags(int flags) Write a value in the fieldflags.- Parameters:
flags- The new value for the fieldflags
-
readArg
-
writeArg
Write a value in the fieldarg.- Parameters:
arg- The new value for the fieldarg
-
readArgData
Read the value of the fieldarg_data.- Returns:
- The value of the field
arg_data
-
writeArgData
Write a value in the fieldarg_data.- Parameters:
argData- The new value for the fieldarg_data
-
readDescription
Read the value of the fielddescription.- Returns:
- The value of the field
description
-
writeDescription
-
readArgDescription
Read the value of the fieldarg_description.- Returns:
- The value of the field
arg_description
-
writeArgDescription
-