<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="cutter-Assertion-Utilities-for-GHashTable">
<refmeta>
<refentrytitle role="top_of_page" id="cutter-Assertion-Utilities-for-GHashTable.top_of_page">GHashTable用の検証ユーティリティ</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>Cutterライブラリ</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GHashTable用の検証ユーティリティ</refname>
<refpurpose><link linkend="GHashTable"><type>GHashTable</type></link>に関する検証をもっと簡単に書くためのユーティリティ。</refpurpose>
</refnamediv>

<refsect1 id="cutter-Assertion-Utilities-for-GHashTable.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_return" colwidth="150px"/>
<colspec colname="functions_name"/>
<tbody>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gcut-hash-table-equal">gcut_hash_table_equal</link> <phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link> *
</entry><entry role="function_name"><link linkend="gcut-hash-table-inspect">gcut_hash_table_inspect</link> <phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link> *
</entry><entry role="function_name"><link linkend="gcut-hash-table-inspect-sorted">gcut_hash_table_inspect_sorted</link> <phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gcut-hash-table-string-equal">gcut_hash_table_string_equal</link> <phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link> *
</entry><entry role="function_name"><link linkend="gcut-hash-table-string-string-inspect">gcut_hash_table_string_string_inspect</link> <phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GHashTable"><returnvalue>GHashTable</returnvalue></link> *
</entry><entry role="function_name"><link linkend="gcut-hash-table-string-string-copy">gcut_hash_table_string_string_copy</link> <phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="cutter-Assertion-Utilities-for-GHashTable.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">オブジェクト階層</title>
<screen>
</screen>
</refsect1>


<refsect1 id="cutter-Assertion-Utilities-for-GHashTable.description" role="desc">
<title role="desc.title">説明</title>
<para>検証を書くためには等価性を検証し、期待値と実測値を表示する必要があります。</para>
<para>このユーティリティは<link linkend="GHashTable"><type>GHashTable</type></link>に関する検証の作成を補助します。</para>

</refsect1>
<refsect1 id="cutter-Assertion-Utilities-for-GHashTable.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gcut-hash-table-equal" role="function" condition="since:1.0.5">
<title>gcut_hash_table_equal ()</title>
<indexterm zone="gcut-hash-table-equal" role="1.0.5"><primary>gcut_hash_table_equal</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gcut_hash_table_equal (<parameter><link linkend="GHashTable"><type>GHashTable</type></link> *hash1</parameter>,
                       <parameter><link linkend="GHashTable"><type>GHashTable</type></link> *hash2</parameter>,
                       <parameter><link linkend="GEqualFunc"><type>GEqualFunc</type></link> equal_func</parameter>);</programlisting>
<para>Compares two <link linkend="GHashTable"><type>GHashTable</type></link>, <parameter>hash1</parameter>
 and
<parameter>hash2</parameter>
. <parameter>equal_func</parameter>
 is called for each values of
the same key of <parameter>hash1</parameter>
 and <parameter>hash2</parameter>
.</para>
<para>例:</para>
<informalexample><programlisting><![CDATA[
TODO
]]></programlisting></informalexample>
<para/>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>hash1</para></entry>
<entry role="parameter_description"><para>比較する<link linkend="GHashTable"><type>GHashTable</type></link>。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>hash2</para></entry>
<entry role="parameter_description"><para>比較する<link linkend="GHashTable"><type>GHashTable</type></link>。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>equal_func</para></entry>
<entry role="parameter_description"><para>ふたつの値を比較する関数。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> TRUE if all same key's values of <parameter>hash1</parameter>
and
<parameter>hash2</parameter>
are reported TRUE by <parameter>equal_func</parameter>
, FALSE
otherwise.</para>
<para/>
</refsect3><para role="since">1.0.5から</para></refsect2>
<refsect2 id="gcut-hash-table-inspect" role="function" condition="since:1.0.5">
<title>gcut_hash_table_inspect ()</title>
<indexterm zone="gcut-hash-table-inspect" role="1.0.5"><primary>gcut_hash_table_inspect</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link> *
gcut_hash_table_inspect (<parameter><link linkend="GHashTable"><type>GHashTable</type></link> *hash</parameter>,
                         <parameter><link linkend="GCutInspectFunction"><type>GCutInspectFunction</type></link> key_inspect_func</parameter>,
                         <parameter><link linkend="GCutInspectFunction"><type>GCutInspectFunction</type></link> value_inspect_func</parameter>,
                         <parameter><link linkend="gpointer"><type>gpointer</type></link> user_data</parameter>);</programlisting>
<para>Inspects <parameter>hash</parameter>
. Each key of <parameter>hash</parameter>
 is inspected by
<parameter>key_inspect_func</parameter>
 and each value of <parameter>hash</parameter>
 is inspected by
<parameter>value_inspect_func</parameter>
. The returned string should be freed
when no longer needed.</para>
<para>例:</para>
<informalexample><programlisting><![CDATA[
TODO
]]></programlisting></informalexample>
<para/>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>hash</para></entry>
<entry role="parameter_description"><para>詳細を示す<link linkend="GHashTable"><type>GHashTable</type></link>。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>key_inspect_func</para></entry>
<entry role="parameter_description"><para>各キーの詳細を示す関数。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>value_inspect_func</para></entry>
<entry role="parameter_description"><para>各値の詳細を示す関数。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>user_data</para></entry>
<entry role="parameter_description"><para>関数に渡すユーザ用データ。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para><parameter>hash</parameter>の詳細を示した文字列。</para>
<para/>
</refsect3><para role="since">1.0.5から</para></refsect2>
<refsect2 id="gcut-hash-table-inspect-sorted" role="function" condition="since:1.0.9">
<title>gcut_hash_table_inspect_sorted ()</title>
<indexterm zone="gcut-hash-table-inspect-sorted" role="1.0.9"><primary>gcut_hash_table_inspect_sorted</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link> *
gcut_hash_table_inspect_sorted (<parameter><link linkend="GHashTable"><type>GHashTable</type></link> *hash</parameter>,
                                <parameter><link linkend="GCutInspectFunction"><type>GCutInspectFunction</type></link> key_inspect_func</parameter>,
                                <parameter><link linkend="GCutInspectFunction"><type>GCutInspectFunction</type></link> value_inspect_func</parameter>,
                                <parameter><link linkend="GCompareFunc"><type>GCompareFunc</type></link> key_compare_func</parameter>,
                                <parameter><link linkend="gpointer"><type>gpointer</type></link> user_data</parameter>);</programlisting>
<para>Sorts <parameter>hash</parameter>
 as key by <parameter>key_compare_func</parameter>
 and inspects
it. Each key of <parameter>hash</parameter>
 is inspected by <parameter>key_inspect_func</parameter>

and each value of <parameter>hash</parameter>
 is inspected by
<parameter>value_inspect_func</parameter>
. The returned string should be freed
when no longer needed.</para>
<para><parameter>key_compare_func</parameter>が<link linkend="NULL:CAPS"><literal>NULL</literal></link>なら<parameter>hash</parameter>を並び替えません。これは<link linkend="gcut-hash-table-inspect"><function>gcut_hash_table_inspect()</function></link>と同じ動作です。</para>
<para>例:</para>
<informalexample><programlisting><![CDATA[
TODO
]]></programlisting></informalexample>
<para/>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>hash</para></entry>
<entry role="parameter_description"><para>並び替えて詳細を示す<link linkend="GHashTable"><type>GHashTable</type></link>。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>key_inspect_func</para></entry>
<entry role="parameter_description"><para>各キーの詳細を示す関数。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>value_inspect_func</para></entry>
<entry role="parameter_description"><para>各値の詳細を示す関数。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>key_compare_func</para></entry>
<entry role="parameter_description"><para>各キーを比較する関数。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>user_data</para></entry>
<entry role="parameter_description"><para>関数に渡すユーザ用データ。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para><parameter>hash</parameter>を並び替えて詳細を示した文字列。</para>
<para/>
</refsect3><para role="since">1.0.9から</para></refsect2>
<refsect2 id="gcut-hash-table-string-equal" role="function" condition="since:1.0.5">
<title>gcut_hash_table_string_equal ()</title>
<indexterm zone="gcut-hash-table-string-equal" role="1.0.5"><primary>gcut_hash_table_string_equal</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gcut_hash_table_string_equal (<parameter><link linkend="GHashTable"><type>GHashTable</type></link> *hash1</parameter>,
                              <parameter><link linkend="GHashTable"><type>GHashTable</type></link> *hash2</parameter>);</programlisting>
<para>Compares two <link linkend="GHashTable"><type>GHashTable</type></link>, <parameter>hash1</parameter>
 and
<parameter>hash2</parameter>
. <parameter>hash1</parameter>
 and <parameter>hash2</parameter>
 should have string key and
string value.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>hash1</para></entry>
<entry role="parameter_description"><para>比較する<link linkend="GHashTable"><type>GHashTable</type></link>。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>hash2</para></entry>
<entry role="parameter_description"><para>比較する<link linkend="GHashTable"><type>GHashTable</type></link>。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para><parameter>hash1</parameter>と<parameter>hash2</parameter>の同じキーの値それぞれすべてが同じ内容の文字列の場合TRUE、そうでない場合はFALSE。</para>
<para/>
</refsect3><para role="since">1.0.5から</para></refsect2>
<refsect2 id="gcut-hash-table-string-string-inspect" role="function" condition="since:1.0.5">
<title>gcut_hash_table_string_string_inspect ()</title>
<indexterm zone="gcut-hash-table-string-string-inspect" role="1.0.5"><primary>gcut_hash_table_string_string_inspect</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link> *
gcut_hash_table_string_string_inspect (<parameter><link linkend="GHashTable"><type>GHashTable</type></link> *hash</parameter>);</programlisting>
<para>Inspects <parameter>hash</parameter>
. <parameter>hash</parameter>
 should have string key and string
value. The returned string should be freed when no longer
needed.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>hash</para></entry>
<entry role="parameter_description"><para>詳細を示す<link linkend="GHashTable"><type>GHashTable</type></link>。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para><parameter>hash</parameter>の詳細を示した文字列。</para>
<para/>
</refsect3><para role="since">1.0.5から</para></refsect2>
<refsect2 id="gcut-hash-table-string-string-copy" role="function" condition="since:1.0.8">
<title>gcut_hash_table_string_string_copy ()</title>
<indexterm zone="gcut-hash-table-string-string-copy" role="1.0.8"><primary>gcut_hash_table_string_string_copy</primary></indexterm>
<programlisting language="C"><link linkend="GHashTable"><returnvalue>GHashTable</returnvalue></link> *
gcut_hash_table_string_string_copy (<parameter><link linkend="GHashTable"><type>GHashTable</type></link> *hash</parameter>);</programlisting>
<para>Copy <parameter>hash</parameter>
. <parameter>hash</parameter>
 should have string key and string
value. The returned <parameter>hash</parameter>
 should be freed by
<link linkend="g-hash-table-unref"><function>g_hash_table_unref()</function></link>.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>hash</para></entry>
<entry role="parameter_description"><para>複製する<link linkend="GHashTable"><type>GHashTable</type></link>。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para>複製された<link linkend="GHashTable"><type>GHashTable</type></link>。必要がなくなったら開放しなければいけません。</para>
<para/>
</refsect3><para role="since">1.0.8から</para></refsect2>

</refsect1>
<refsect1 id="cutter-Assertion-Utilities-for-GHashTable.other_details" role="details">
<title role="details.title">Types and Values</title>

</refsect1>

</refentry>
