OptionEntry

constructor()

Allocate a new OptionEntry.

This instance will be allocated on the native heap and automatically freed when this class instance is garbage collected.


constructor(scope: <Error class: unknown class>)

Allocate a new OptionEntry using the provided AutofreeScope.

The AutofreeScope manages the allocation lifetime. The most common usage is with memScoped.

Parameters

scope

The AutofreeScope to allocate this structure in.


constructor(longName: String?, shortName: Char, flags: <Error class: unknown class>, arg: OptionArg, argData: <Error class: unknown class>, description: String?, argDescription: String?)

Allocate a new OptionEntry.

This instance will be allocated on the native heap and automatically freed when this class instance is garbage collected.

Parameters

longName

The long name of an option can be used to specify it in a commandline as --long_name. Every option must have a long name. To resolve conflicts if multiple option groups contain the same long name, it is also possible to specify the option as --groupname-long_name.

shortName

If an option has a short name, it can be specified -short_name in a commandline. @short_name must be a printable ASCII character different from '-', or zero if the option has no short name.

flags

Flags from #GOptionFlags

arg

The type of the option, as a #GOptionArg

argData

If the @arg type is %G_OPTION_ARG_CALLBACK, then @arg_data must point to a #GOptionArgFunc callback function, which will be called to handle the extra argument. Otherwise, @arg_data is a pointer to a location to store the value, the required type of the location depends on the @arg type: - %G_OPTION_ARG_NONE: %gboolean - %G_OPTION_ARG_STRING: %gchar* - %G_OPTION_ARG_INT: %gint - %G_OPTION_ARG_FILENAME: %gchar* - %G_OPTION_ARG_STRING_ARRAY: %gchar** - %G_OPTION_ARG_FILENAME_ARRAY: %gchar** - %G_OPTION_ARG_DOUBLE: %gdouble If @arg type is %G_OPTION_ARG_STRING or %G_OPTION_ARG_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 %G_OPTION_ARG_STRING_ARRAY or %G_OPTION_ARG_FILENAME_ARRAY, the data should be freed using g_strfreev().

description

the description for the option in --help output. The @description is translated using the @translate_func of the group, see g_option_group_set_translation_domain().

argDescription

The placeholder to use for the extra argument parsed by the option in --help output. The @arg_description is translated using the @translate_func of the group, see g_option_group_set_translation_domain().


constructor(longName: String?, shortName: Char, flags: <Error class: unknown class>, arg: OptionArg, argData: <Error class: unknown class>, description: String?, argDescription: String?, scope: <Error class: unknown class>)

Allocate a new OptionEntry using the provided AutofreeScope.

The AutofreeScope manages the allocation lifetime. The most common usage is with memScoped.

Parameters

longName

The long name of an option can be used to specify it in a commandline as --long_name. Every option must have a long name. To resolve conflicts if multiple option groups contain the same long name, it is also possible to specify the option as --groupname-long_name.

shortName

If an option has a short name, it can be specified -short_name in a commandline. @short_name must be a printable ASCII character different from '-', or zero if the option has no short name.

flags

Flags from #GOptionFlags

arg

The type of the option, as a #GOptionArg

argData

If the @arg type is %G_OPTION_ARG_CALLBACK, then @arg_data must point to a #GOptionArgFunc callback function, which will be called to handle the extra argument. Otherwise, @arg_data is a pointer to a location to store the value, the required type of the location depends on the @arg type: - %G_OPTION_ARG_NONE: %gboolean - %G_OPTION_ARG_STRING: %gchar* - %G_OPTION_ARG_INT: %gint - %G_OPTION_ARG_FILENAME: %gchar* - %G_OPTION_ARG_STRING_ARRAY: %gchar** - %G_OPTION_ARG_FILENAME_ARRAY: %gchar** - %G_OPTION_ARG_DOUBLE: %gdouble If @arg type is %G_OPTION_ARG_STRING or %G_OPTION_ARG_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 %G_OPTION_ARG_STRING_ARRAY or %G_OPTION_ARG_FILENAME_ARRAY, the data should be freed using g_strfreev().

description

the description for the option in --help output. The @description is translated using the @translate_func of the group, see g_option_group_set_translation_domain().

argDescription

The placeholder to use for the extra argument parsed by the option in --help output. The @arg_description is translated using the @translate_func of the group, see g_option_group_set_translation_domain().

scope

The AutofreeScope to allocate this structure in.


constructor(pointer: <Error class: unknown class><<Error class: unknown class>>, cleaner: <Error class: unknown class>? = null)