| Cutterリファレンスマニュアル | ||||
|---|---|---|---|---|
| Top | 説明 | ||||
GObject * gcut_take_object (GObject *object); GError * gcut_take_error (GError *error); const GList * gcut_take_list (const GList *list,CutDestroyFunction destroy_function); GHashTable * gcut_take_hash_table (GHashTable *hash_table); GString * gcut_take_string (GString *string); GString * gcut_take_new_string (const gchar *string); GList * gcut_list_new (const gpointer element,...); GList * gcut_list_int_new (guint n,gint value,...); GList * gcut_list_uint_new (guint n,guint value,...); GList * gcut_list_string_new (const gchar *value,...); GList * gcut_list_string_new_array (const gchar **strings); const GList * gcut_take_new_list_int (guint n,gint value,...); const GList * gcut_take_new_list_uint (guint n,guint value,...); const GList * gcut_take_new_list_string (const gchar *value,...); #define gcut_take_new_list_string_backward_compatibility(value, ...) const GList * gcut_take_new_list_string_array (const gchar **strings); #define gcut_take_new_list_object (object, ...) void gcut_list_string_free (GList *list); void gcut_list_object_free (GList *list); GHashTable * gcut_hash_table_string_string_new (const gchar *key,...); GHashTable * gcut_hash_table_string_string_new_va_list (const gchar *key,va_list args); GHashTable * gcut_take_new_hash_table_string_string (const gchar *key,...); GString * gcut_get_fixture_data (const gchar *path,...);
テストを書くためには、テスト環境を前処理・後処理するコードや、検証する結果を準備するコードなどたくさんのコードを書く必要があります。Cutterはもっと簡単にテストを書くためにユーティリティを提供します。
このユーティリティはGLibと一緒に使います。
GObject * gcut_take_object (GObject *object);
objectの所有権をCutterに渡し、objectを返します。
|
Cutterに所有権を渡すGObject。 |
戻り値 : |
Cutterが所有権をもつobject。g_object_unref()しないでください。 |
1.0.3から
GError * gcut_take_error (GError *error);
Cutterにerrorの所有権を渡し、errorそれ自身を返します。
|
Cutterに所有権を渡すGError。 |
戻り値 : |
Cutterが所有権をもつGError。g_error_free()しないでください。 |
1.0.3から
const GList * gcut_take_list (const GList *list,CutDestroyFunction destroy_function);
listの所有権をCutterに渡し、listそれ自身を返します。
|
Cutterに所有権を渡すGList。 |
|
listの各要素を破棄する関数、またはNULL。 |
戻り値 : |
Cutterが所有権を持つGList。g_list_free()しないでください。 |
1.0.3から
GHashTable * gcut_take_hash_table (GHashTable *hash_table);
hash_tableの所有権をCutterに渡し、hash_tableそれ自身を返します。
|
Cutterに所有権を渡すGHashTable。 |
戻り値 : |
Cutterが所有権をもつGHashTable。g_hash_table_unref()しないでください。 |
1.0.4から
GString * gcut_take_string (GString *string);
stringの所有権をCutterに渡し、stringそれ自身を返します。
|
Cutterに所有権を渡すGString。 |
戻り値 : |
Cutterが所有権を持つGString。g_string_free()しないでください。 |
1.1.6から
GString * gcut_take_new_string (const gchar *string);
渡された文字列からGStringを作成します。
|
文字列。NULLも可。 |
戻り値 : |
Cutterが所有権を持つGString。g_string_free()しないでください。 |
1.1.6から
GList * gcut_list_new (const gpointer element,...);
渡された要素を含むリストを作ります。
例:
1 2 3 4 5 |
GCutEgg *echo_egg, *cat_egg; echo_egg = gcut_egg_new("echo", "Hello", NULL); cat_egg = gcut_egg_new("cat", "/etc/hosts", NULL); egg_list = gcut_list_new(echo_egg, cat_egg, NULL); |
|
最初のgpointer。 |
|
パスの残りの要素。NULL終端。 |
戻り値 : |
新しく割り当てられたGList。渡された要素を持ちます。 |
1.1.1から
GList * gcut_list_int_new (guint n,gint value,...);
渡された整数からリストを作ります。
例:
1 |
gcut_list_int_new(3, -10, 1, 29); -> (-10, 1, 29) |
|
整数の数。 |
|
最初の整数値。 |
|
リストの残りの整数値。 |
戻り値 : |
渡された整数を含むGList。g_list_free()で開放すること。 |
1.1.5から
GList * gcut_list_uint_new (guint n,guint value,...);
渡された符号無し整数からリストを作ります。
例:
1 |
gcut_list_uint_new(3, 0, 1, 2); -> (0, 1, 2) |
|
符号無し符号整数の数。 |
|
最初の符号無し符号整数値。 |
|
リストの残りの符号無し符号整数値。 |
戻り値 : |
渡された符号無し整数を含むGList。g_list_free()で開放すること。 |
1.1.5から
GList * gcut_list_string_new (const gchar *value,...);
渡された文字列からリストを作ります。
|
最初の文字列。 |
|
リストの残りの文字列。NULL終端。 |
戻り値 : |
渡された文字列を含むGList。gcut_list_string_free()で開放すること。 |
1.0.3から
GList * gcut_list_string_new_array (const gchar **strings);
渡された文字列配列からリストを作ります。
|
文字列の配列。NULL終端。 |
戻り値 : |
渡された文字列配列と同じ内容のGList。gcut_list_string_free()で開放すること。 |
1.0.6から
const GList * gcut_take_new_list_int (guint n,gint value,...);
渡された整数からリストを作ります。作られたリストはCutterが所有権を持ちます。
例:
1 |
gcut_take_new_list_int(3, -10, 1, 29); -> (-10, 1, 29) |
|
整数の数。 |
|
最初の整数値。 |
|
リストの残りの文字列。 |
戻り値 : |
渡された整数と同じ内容のGList。Cutterが所有権を持ちます。 |
1.1.5から
const GList * gcut_take_new_list_uint (guint n,guint value,...);
渡された符号無し整数からリストを作ります。作られたリストはCutterが所有権を持ちます。
例:
1 |
gcut_take_new_list_uint(3, 0, 1, 2); -> (0, 1, 2) |
|
符号無し符号整数の数。 |
|
最初の符号無し符号整数値。 |
|
リストの残りの文字列。 |
戻り値 : |
渡された符号無し整数と同じ内容のGList。Cutterが所有権を持ちます。 |
1.1.5から
const GList * gcut_take_new_list_string (const gchar *value,...);
渡された文字列からリストを作ります。作られたリストはCutterが所有権を持ちます。
|
最初の文字列。 |
|
リストの残りの文字列。NULL終端。 |
戻り値 : |
渡された文字列と同じ内容のGList。Cutterが所有権を持ちます。 |
1.0.5から
#define gcut_take_new_list_string_backward_compatibility(value, ...)
gcut_take_new_list_string_backward_compatibilityは非推奨です。新しいコードでは使わないでください。
|
|
|
const GList * gcut_take_new_list_string_array (const gchar **strings);
渡された文字列の配列からリストを作ります。Cutterが所有権を持ちます。
|
文字列の配列。NULL終端。 |
戻り値 : |
渡された文字列の配列と同じ内容のGList。Cutterが所有。 |
1.0.6から
#define gcut_take_new_list_object(object, ...)
渡されたオブジェクトからリストを作ります。作られたリストはCutterが所有権を持ちます。
|
最初のGObject。 |
|
リストの残りのオブジェクト。NULL終端。 |
戻り値 : |
新しく割り当てられたGList。リストには渡されたオブジェクトが含まれます。Cutterが所有権を持ちます。 |
1.1.1から
void gcut_list_string_free (GList *list);
listとlist内にある文字列を開放します。
|
開放する文字列のリスト。 |
1.0.3から
void gcut_list_object_free (GList *list);
listと中のオブジェクトを破棄します。listにNULLが含まれていても大丈夫です。
|
リファレンスを減らしたいGObjectを含んだリスト。 |
1.1.1から
GHashTable * gcut_hash_table_string_string_new (const gchar *key,...);
引数で指定されたキーと値のペアから、文字列のキーと値を持つハッシュテーブルを作成します。
|
最初のキー文字列。 |
|
残りの引数のNULL終端のリスト。まず、最初のキーの文字列値を指定します。続いて、任意の数だけキー・値のペアを指定します。最後にNULLを指定しなければいけません。 |
戻り値 : |
渡されたキー・値を持つGHashTable。g_hash_table_unref()で開放してください。 |
1.0.4から
GHashTable * gcut_hash_table_string_string_new_va_list (const gchar *key,va_list args);
引数で指定されたキーと値のペアから、文字列のキーと値を持つハッシュテーブルを作成します。
|
最初のキー文字列。 |
|
残りの引数のNULL終端のリスト。まず、最初のキーの文字列値を指定します。続いて、任意の数だけキー・値のペアを指定します。最後にNULLを指定しなければいけません。 |
戻り値 : |
渡されたキー・値を持つGHashTable。g_hash_table_unref()で開放してください。 |
1.0.5から
GHashTable * gcut_take_new_hash_table_string_string (const gchar *key,...);
渡されたキー・値のペアから文字列のキー・値を持つハッシュテーブルを作成します。作成されたハッシュテーブルはCutterが所有権を持つので、g_hash_table_unref()を呼ばないでください。
|
最初のキー文字列。 |
|
残りの引数のNULL終端のリスト。まず、最初のキーの文字列値を指定します。続いて、任意の数だけキー・値のペアを指定します。最後にNULLを指定しなければいけません。 |
戻り値 : |
渡されたキー・値を持つGHashTable。 |
1.0.5から
GString * gcut_get_fixture_data (const gchar *path,...);
path/..."にあるフィクスチャデータを読み込み、GStringとして返します。GStringはCutterが所持します。cut_build_fixture_data_path()の説明にはフィクスチャデータのパスがどのように決定されるかが書かれています。
|
フィクスチャデータのパスの最初の要素。 |
|
パスの残りの要素。NULL終端が必須です。 |
戻り値 : |
フィクスチャデータの内容が入ったGString。GStringはCutterが所持します。開放しないでください。 |
1.1.6から