Function

NM-1.0NMutils_enum_from_strSince 1.2

  • Converts a string to the matching enum value.

    If the enum is a G_TYPE_FLAGS the function returns the logical OR of values matching the comma-separated tokens in the string; if an unknown token is found the function returns false and stores a pointer to a newly allocated string containing the unrecognized token in err_token.

    Parameters

    • type: GType

      the %GType of the enum

    • str: string

      the input string

    Returns [boolean, number, string]

    true if the conversion was successful, false otherwise

    1.2