Enum module

Enum module — enum parsing

Functions

Types and Values

Description

Functions

nk_enum_parse ()

gboolean
nk_enum_parse (const gchar *string,
               const gchar * const *values,
               guint64 size,
               NkEnumMatchFlags flags,
               guint64 *value);

Searches in values if a string is matching string .

If the function returns TRUE, value will be set to the index of the matching string from values .

If the function returns FALSE, value is left untouched.

Parameters

string

a string

 

values

a list of strings representing the enum names.

[array length=size]

size

the size of values

 

flags

NkEnumMatchFlags to modify matching behaviour

 

value

the enum value.

[out]

Returns

TRUE if string matches an enum name, FALSE otherwise

Types and Values

enum NkEnumMatchFlags

Flags which modify string matching.

Members

NK_ENUM_MATCH_FLAGS_NONE

No flags, full case-sensitive matching

 

NK_ENUM_MATCH_FLAGS_IGNORE_CASE

Case-insensitive matching

 

NK_ENUM_MATCH_FLAGS_PREFIX_VALUE

Matches if the string is a prefix to the enum value name

 

NK_ENUM_MATCH_FLAGS_PREFIX_STRING

Matches if the enum value name is a prefix to the string