Top | ![]() |
![]() |
![]() |
![]() |
Assertion Utilities for GEnum and GFlagsAssertion Utilities for GEnum and GFlags — Utilities to write assertions related to GEnum or GFlags more easily. |
#define | GCUT_ENUM_ERROR |
GQuark | gcut_enum_error_quark () |
gchar * | gcut_enum_inspect () |
gint | gcut_enum_parse () |
gchar * | gcut_flags_inspect () |
guint | gcut_flags_parse () |
guint | gcut_flags_get_all () |
To write assertions, you need to check equality and show expected and actual values.
The utilities help you to write assertions that are related to GEnum or GFlags.
#define GCUT_ENUM_ERROR (gcut_enum_error_quark())
Error domain for enum related operations. Errors in this domain will be from the GCutEnumError enumeration.
Since 1.0.6
gchar * gcut_enum_inspect (GType enum_type
,gint enum_value
);
Inspects enum_type
value, enum_value
. The returned
string should be freed when no longer needed.
Since 1.0.5
gint gcut_enum_parse (GType enum_type
,const gchar *enum_value
,GError **error
);
Parses enum_value
and returns a enum value of
enum_type
. enum_value
should be enum name or nick
name. If enum_value
isn't match then error
is set to a
GCutEnumError.
enum_type |
a GEnum type. |
|
enum_value |
a string to be parsed. |
|
error |
return location for an error, or |
Since 1.0.6
gchar * gcut_flags_inspect (GType flags_type
,guint flags_value
);
Inspects flags_type
value, flags_value
. The returned
string should be freed when no longer needed.
Since 1.0.5
guint gcut_flags_parse (GType flags_type
,const gchar *flags_value
,GError **error
);
Parses flags_value
and returns a flags value of
flags_type
. flags_value
should be formated as
"nick-or-name1|nick-or-name2|...|nick-or-nameN". If
flags_value
includes unknown flag then error
is set to
a GCutEnumError.
flags_type |
a GFlags type. |
|
flags_value |
a string to be parsed. |
|
error |
return location for an error, or |
Since 1.0.6