<?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-GEnum-and-GFlags">
<refmeta>
<refentrytitle role="top_of_page" id="cutter-Assertion-Utilities-for-GEnum-and-GFlags.top_of_page">GEnumとGFlags用の検証ユーティリティ</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>Cutterライブラリ</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GEnumとGFlags用の検証ユーティリティ</refname>
<refpurpose><link linkend="GEnum"><type>GEnum</type></link>または<link linkend="GFlags"><type>GFlags</type></link>に関する検証をもっと簡単に書くためのユーティリティ。</refpurpose>
</refnamediv>

<refsect1 id="cutter-Assertion-Utilities-for-GEnum-and-GFlags.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="define_keyword">#define</entry><entry role="function_name"><link linkend="GCUT-ENUM-ERROR:CAPS">GCUT_ENUM_ERROR</link></entry></row>
<row><entry role="function_type"><link linkend="GQuark"><returnvalue>GQuark</returnvalue></link>
</entry><entry role="function_name"><link linkend="gcut-enum-error-quark">gcut_enum_error_quark</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-enum-inspect">gcut_enum_inspect</link> <phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint"><returnvalue>gint</returnvalue></link>
</entry><entry role="function_name"><link linkend="gcut-enum-parse">gcut_enum_parse</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-flags-inspect">gcut_flags_inspect</link> <phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint"><returnvalue>guint</returnvalue></link>
</entry><entry role="function_name"><link linkend="gcut-flags-parse">gcut_flags_parse</link> <phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint"><returnvalue>guint</returnvalue></link>
</entry><entry role="function_name"><link linkend="gcut-flags-get-all">gcut_flags_get_all</link> <phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="cutter-Assertion-Utilities-for-GEnum-and-GFlags.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="name" colwidth="150px"/>
<colspec colname="description"/>
<tbody>
<row><entry role="datatype_keyword">enum</entry><entry role="function_name"><link linkend="GCutEnumError">GCutEnumError</link></entry></row>

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


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

</refsect1>
<refsect1 id="cutter-Assertion-Utilities-for-GEnum-and-GFlags.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="GCUT-ENUM-ERROR:CAPS" role="macro" condition="since:1.0.6">
<title>GCUT_ENUM_ERROR</title>
<indexterm zone="GCUT-ENUM-ERROR:CAPS" role="1.0.6"><primary>GCUT_ENUM_ERROR</primary></indexterm>
<programlisting language="C">#define GCUT_ENUM_ERROR (gcut_enum_error_quark())
</programlisting>
<para>列挙型関連操作用のエラードメインです。このドメインのエラーは<link linkend="GCutEnumError"><type>GCutEnumError</type></link>列挙型のどれかです。</para>
<para role="since">1.0.6から</para></refsect2>
<refsect2 id="gcut-enum-error-quark" role="function">
<title>gcut_enum_error_quark ()</title>
<indexterm zone="gcut-enum-error-quark"><primary>gcut_enum_error_quark</primary></indexterm>
<programlisting language="C"><link linkend="GQuark"><returnvalue>GQuark</returnvalue></link>
gcut_enum_error_quark (<parameter><type>void</type></parameter>);</programlisting>
<para>
</para>
<refsect3 role="returns">
<title>Returns</title>

<para/>
</refsect3></refsect2>
<refsect2 id="gcut-enum-inspect" role="function" condition="since:1.0.5">
<title>gcut_enum_inspect ()</title>
<indexterm zone="gcut-enum-inspect" role="1.0.5"><primary>gcut_enum_inspect</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link> *
gcut_enum_inspect (<parameter><link linkend="GType"><type>GType</type></link> enum_type</parameter>,
                   <parameter><link linkend="gint"><type>gint</type></link> enum_value</parameter>);</programlisting>
<para>Inspects <parameter>enum_type</parameter>
 value, <parameter>enum_value</parameter>
. 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>enum_type</para></entry>
<entry role="parameter_description"><para><link linkend="GEnum"><type>GEnum</type></link>の型。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>enum_value</para></entry>
<entry role="parameter_description"><para>詳細を示す<link linkend="GEnum"><type>GEnum</type></link>の値。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para><parameter>enum_value</parameter>の詳細を示した文字列。</para>
<para/>
</refsect3><para role="since">1.0.5から</para></refsect2>
<refsect2 id="gcut-enum-parse" role="function" condition="since:1.0.6">
<title>gcut_enum_parse ()</title>
<indexterm zone="gcut-enum-parse" role="1.0.6"><primary>gcut_enum_parse</primary></indexterm>
<programlisting language="C"><link linkend="gint"><returnvalue>gint</returnvalue></link>
gcut_enum_parse (<parameter><link linkend="GType"><type>GType</type></link> enum_type</parameter>,
                 <parameter>const <link linkend="gchar"><type>gchar</type></link> *enum_value</parameter>,
                 <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Parses <parameter>enum_value</parameter>
 and returns a enum value of
<parameter>enum_type</parameter>
. <parameter>enum_value</parameter>
 should be enum name or nick
name. If <parameter>enum_value</parameter>
 isn't match then <parameter>error</parameter>
 is set to a
<link linkend="GCutEnumError"><type>GCutEnumError</type></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>enum_type</para></entry>
<entry role="parameter_description"><para><link linkend="GEnum"><type>GEnum</type></link>の型。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>enum_value</para></entry>
<entry role="parameter_description"><para>パースされる文字列。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>エラーを返すアドレスまたは<link linkend="NULL:CAPS"><literal>NULL</literal></link>。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> enum value of <parameter>enum_type</parameter>
corresponded to <parameter>enum_value</parameter>
.</para>
<para/>
</refsect3><para role="since">1.0.6から</para></refsect2>
<refsect2 id="gcut-flags-inspect" role="function" condition="since:1.0.5">
<title>gcut_flags_inspect ()</title>
<indexterm zone="gcut-flags-inspect" role="1.0.5"><primary>gcut_flags_inspect</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link> *
gcut_flags_inspect (<parameter><link linkend="GType"><type>GType</type></link> flags_type</parameter>,
                    <parameter><link linkend="guint"><type>guint</type></link> flags_value</parameter>);</programlisting>
<para>Inspects <parameter>flags_type</parameter>
 value, <parameter>flags_value</parameter>
. 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>flags_type</para></entry>
<entry role="parameter_description"><para><link linkend="GFlags"><type>GFlags</type></link>の型。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>flags_value</para></entry>
<entry role="parameter_description"><para>詳細を示す<link linkend="GFlags"><type>GFlags</type></link>の値。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para><parameter>flags_value</parameter>の詳細を示した文字列。</para>
<para/>
</refsect3><para role="since">1.0.5から</para></refsect2>
<refsect2 id="gcut-flags-parse" role="function" condition="since:1.0.6">
<title>gcut_flags_parse ()</title>
<indexterm zone="gcut-flags-parse" role="1.0.6"><primary>gcut_flags_parse</primary></indexterm>
<programlisting language="C"><link linkend="guint"><returnvalue>guint</returnvalue></link>
gcut_flags_parse (<parameter><link linkend="GType"><type>GType</type></link> flags_type</parameter>,
                  <parameter>const <link linkend="gchar"><type>gchar</type></link> *flags_value</parameter>,
                  <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Parses <parameter>flags_value</parameter>
 and returns a flags value of
<parameter>flags_type</parameter>
. <parameter>flags_value</parameter>
 should be formated as
"nick-or-name1|nick-or-name2|...|nick-or-nameN". If
<parameter>flags_value</parameter>
 includes unknown flag then <parameter>error</parameter>
 is set to
a <link linkend="GCutEnumError"><type>GCutEnumError</type></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>flags_type</para></entry>
<entry role="parameter_description"><para><link linkend="GFlags"><type>GFlags</type></link>の型。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>flags_value</para></entry>
<entry role="parameter_description"><para>パースされる文字列。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>エラーを返すアドレスまたは<link linkend="NULL:CAPS"><literal>NULL</literal></link>。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> flags value of <parameter>flags_type</parameter>
corresponded to <parameter>flags_value</parameter>
.</para>
<para/>
</refsect3><para role="since">1.0.6から</para></refsect2>
<refsect2 id="gcut-flags-get-all" role="function" condition="since:1.0.6">
<title>gcut_flags_get_all ()</title>
<indexterm zone="gcut-flags-get-all" role="1.0.6"><primary>gcut_flags_get_all</primary></indexterm>
<programlisting language="C"><link linkend="guint"><returnvalue>guint</returnvalue></link>
gcut_flags_get_all (<parameter><link linkend="GType"><type>GType</type></link> flags_type</parameter>,
                    <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>すべてのフラグ値が有効なフラグ値を返します。</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>flags_type</para></entry>
<entry role="parameter_description"><para><link linkend="GFlags"><type>GFlags</type></link>の型。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>エラーを返すアドレスまたは<link linkend="NULL:CAPS"><literal>NULL</literal></link>。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para>すべてのフラグ値が有効なフラグ値。</para>
<para/>
</refsect3><para role="since">1.0.6から</para></refsect2>

</refsect1>
<refsect1 id="cutter-Assertion-Utilities-for-GEnum-and-GFlags.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GCutEnumError" role="enum" condition="since:1.0.6">
<title>enum GCutEnumError</title>
<indexterm zone="GCutEnumError" role="1.0.6"><primary>GCutEnumError</primary></indexterm>
<para>列挙型関連操作で返されるエラーコード。</para>
<refsect3 role="enum_members">
<title>Members</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="enum_members_name" colwidth="300px"/>
<colspec colname="enum_members_description"/>
<colspec colname="enum_members_annotations" colwidth="200px"/>
<tbody>
<row role="constant"><entry role="enum_member_name"><para id="GCUT-ENUM-ERROR-INVALID-TYPE:CAPS">GCUT_ENUM_ERROR_INVALID_TYPE</para></entry>
<entry role="enum_member_description"><para>不正な型。</para>
</entry>
<entry role="enum_member_annotations"/>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GCUT-ENUM-ERROR-INVALID-VALUE:CAPS">GCUT_ENUM_ERROR_INVALID_VALUE</para></entry>
<entry role="enum_member_description"><para>不正な値。</para>
</entry>
<entry role="enum_member_annotations"/>
</row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">1.0.6から</para></refsect2>

</refsect1>

</refentry>
