GEnumとGFlags用の検証ユーティリティ

GEnumとGFlags用の検証ユーティリティ — GEnumまたはGFlagsに関する検証をもっと簡単に書くためのユーティリティ。

Functions

Types and Values

説明

検証を書くためには等価性を検証し、期待値と実測値を表示する必要があります。

このユーティリティはGEnumまたはGFlagsに関する検証の作成を補助します。

Functions

GCUT_ENUM_ERROR

#define GCUT_ENUM_ERROR (gcut_enum_error_quark())

列挙型関連操作用のエラードメインです。このドメインのエラーはGCutEnumError列挙型のどれかです。

Since: 1.0.6


gcut_enum_error_quark ()

GQuark
gcut_enum_error_quark (void);


gcut_enum_inspect ()

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.

Parameters

enum_type

GEnumの型。

 

enum_value

詳細を示すGEnumの値。

 

Returns

enum_valueの詳細を示した文字列。

Since: 1.0.5


gcut_enum_parse ()

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.

Parameters

enum_type

GEnumの型。

 

enum_value

パースされる文字列。

 

error

エラーを返すアドレスまたはNULL

 

Returns

enum value of enum_type corresponded to enum_value .

Since: 1.0.6


gcut_flags_inspect ()

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.

Parameters

flags_type

GFlagsの型。

 

flags_value

詳細を示すGFlagsの値。

 

Returns

flags_valueの詳細を示した文字列。

Since: 1.0.5


gcut_flags_parse ()

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.

Parameters

flags_type

GFlagsの型。

 

flags_value

パースされる文字列。

 

error

エラーを返すアドレスまたはNULL

 

Returns

flags value of flags_type corresponded to flags_value .

Since: 1.0.6


gcut_flags_get_all ()

guint
gcut_flags_get_all (GType flags_type,
                    GError **error);

すべてのフラグ値が有効なフラグ値を返します。

Parameters

flags_type

GFlagsの型。

 

error

エラーを返すアドレスまたはNULL

 

Returns

すべてのフラグ値が有効なフラグ値。

Since: 1.0.6

Types and Values

enum GCutEnumError

列挙型関連操作で返されるエラーコード。

Members

GCUT_ENUM_ERROR_INVALID_TYPE

不正な型。

 

GCUT_ENUM_ERROR_INVALID_VALUE

不正な値。

 

Since: 1.0.6