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