PgMiscellaneous.parseEnum

Parses an enum type and stores the result in value. If str does not match the nick name of any of the possible values for the enum and is not an integer, FALSE is returned, a warning is issued if warn is TRUE, and a string representing the list of possible values is stored in possible_values. The list is slash-separated, eg. "none/start/middle/end". If failed and possible_values is not NULL, returned string should be freed using g_free(). Since 1.16

class PgMiscellaneous
static
int
parseEnum
(,
string str
,
out int value
,
int warn
,
out string possibleValues
)

Parameters

type GType

enum type to parse, eg. PANGO_TYPE_ELLIPSIZE_MODE.

str string

string to parse. May be NULL. [allow-none]

value int

integer to store the result in, or NULL. out[allow-none]

warn int

if TRUE, issue a g_warning() on bad input.

possibleValues string

place to store list of possible values on failure, or NULL. out[allow-none]

Return Value

Type: int

TRUE if str was successfully parsed.

Meta