<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
[
  <!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
]>
<refentry id="AsValidator">
<refmeta>
<refentrytitle role="top_of_page" id="AsValidator.top_of_page">AsValidator</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>APPSTREAM Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>AsValidator</refname>
<refpurpose>Validator and report-generator about AppStream XML metadata</refpurpose>
</refnamediv>

<refsect1 id="AsValidator.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="AS-TYPE-VALIDATOR:CAPS">AS_TYPE_VALIDATOR</link></entry></row>
<row><entry role="function_type"><link linkend="AsValidator"><returnvalue>AsValidator</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="as-validator-new">as_validator_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="as-validator-clear-issues">as_validator_clear_issues</link>&#160;<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="as-validator-validate-file">as_validator_validate_file</link>&#160;<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="as-validator-validate-data">as_validator_validate_data</link>&#160;<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="as-validator-validate-tree">as_validator_validate_tree</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GList"><returnvalue>GList</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="as-validator-get-issues">as_validator_get_issues</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="AsValidator.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">struct</entry><entry role="function_name"><link linkend="AsValidatorClass">AsValidatorClass</link></entry></row>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="AsValidator-struct">AsValidator</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="AsValidator.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> AsValidator
</screen>
</refsect1>

<refsect1 id="AsValidator.includes"><title>Includes</title><synopsis>#include &lt;appstream.h&gt;
</synopsis></refsect1>

<refsect1 id="AsValidator.description" role="desc">
<title role="desc.title">Description</title>
<para>This object is able to validate AppStream XML metadata (distro and upstream)
and to generate a report about issues found with it.</para>
<para>See also: <link linkend="AsMetadata"><type>AsMetadata</type></link></para>

</refsect1>
<refsect1 id="AsValidator.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="AS-TYPE-VALIDATOR:CAPS" role="macro">
<title>AS_TYPE_VALIDATOR</title>
<indexterm zone="AS-TYPE-VALIDATOR:CAPS"><primary>AS_TYPE_VALIDATOR</primary></indexterm>
<programlisting language="C">#define AS_TYPE_VALIDATOR (as_validator_get_type ())
</programlisting>
<para>
</para>
</refsect2>
<refsect2 id="as-validator-new" role="function">
<title>as_validator_new&#160;()</title>
<indexterm zone="as-validator-new"><primary>as_validator_new</primary></indexterm>
<programlisting language="C"><link linkend="AsValidator"><returnvalue>AsValidator</returnvalue></link>&#160;*
as_validator_new (<parameter><type>void</type></parameter>);</programlisting>
<para>Creates a new <link linkend="AsValidator"><type>AsValidator</type></link>.</para>
<refsect3 role="returns">
<title>Returns</title>
<para> an <link linkend="AsValidator"><type>AsValidator</type></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="as-validator-clear-issues" role="function">
<title>as_validator_clear_issues&#160;()</title>
<indexterm zone="as-validator-clear-issues"><primary>as_validator_clear_issues</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
as_validator_clear_issues (<parameter><link linkend="AsValidator"><type>AsValidator</type></link> *validator</parameter>);</programlisting>
<para>Clears the list of issues</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>validator</para></entry>
<entry role="parameter_description"><para>An instance of <link linkend="AsValidator"><type>AsValidator</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="as-validator-validate-file" role="function">
<title>as_validator_validate_file&#160;()</title>
<indexterm zone="as-validator-validate-file"><primary>as_validator_validate_file</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
as_validator_validate_file (<parameter><link linkend="AsValidator"><type>AsValidator</type></link> *validator</parameter>,
                            <parameter><link linkend="GFile"><type>GFile</type></link> *metadata_file</parameter>);</programlisting>
<para>Validate an AppStream XML file</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>validator</para></entry>
<entry role="parameter_description"><para>An instance of <link linkend="AsValidator"><type>AsValidator</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>metadata_file</para></entry>
<entry role="parameter_description"><para>An AppStream XML file.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="as-validator-validate-data" role="function">
<title>as_validator_validate_data&#160;()</title>
<indexterm zone="as-validator-validate-data"><primary>as_validator_validate_data</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
as_validator_validate_data (<parameter><link linkend="AsValidator"><type>AsValidator</type></link> *validator</parameter>,
                            <parameter>const <link linkend="gchar"><type>gchar</type></link> *metadata</parameter>);</programlisting>
<para>Validate AppStream XML data</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>validator</para></entry>
<entry role="parameter_description"><para>An instance of <link linkend="AsValidator"><type>AsValidator</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>metadata</para></entry>
<entry role="parameter_description"><para>XML metadata.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="as-validator-validate-tree" role="function">
<title>as_validator_validate_tree&#160;()</title>
<indexterm zone="as-validator-validate-tree"><primary>as_validator_validate_tree</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
as_validator_validate_tree (<parameter><link linkend="AsValidator"><type>AsValidator</type></link> *validator</parameter>,
                            <parameter>const <link linkend="gchar"><type>gchar</type></link> *root_dir</parameter>);</programlisting>
<para>Validate a full directory tree for issues in AppStream metadata.</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>validator</para></entry>
<entry role="parameter_description"><para>An instance of <link linkend="AsValidator"><type>AsValidator</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>root_dir</para></entry>
<entry role="parameter_description"><para>The root directory of the filesystem tree that should be validated.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="as-validator-get-issues" role="function">
<title>as_validator_get_issues&#160;()</title>
<indexterm zone="as-validator-get-issues"><primary>as_validator_get_issues</primary></indexterm>
<programlisting language="C"><link linkend="GList"><returnvalue>GList</returnvalue></link>&#160;*
as_validator_get_issues (<parameter><link linkend="AsValidator"><type>AsValidator</type></link> *validator</parameter>);</programlisting>
<para>Get a list of found metadata format issues.</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>validator</para></entry>
<entry role="parameter_description"><para>An instance of <link linkend="AsValidator"><type>AsValidator</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> a list of <link linkend="AsValidatorIssue"><type>AsValidatorIssue</type></link> instances, free with <link linkend="g-list-free"><function>g_list_free()</function></link>. </para>
<para><emphasis role="annotation">[<acronym>element-type</acronym> AsValidatorIssue][<acronym>transfer container</acronym>]</emphasis></para>
</refsect3></refsect2>

</refsect1>
<refsect1 id="AsValidator.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="AsValidatorClass" role="struct">
<title>struct AsValidatorClass</title>
<indexterm zone="AsValidatorClass"><primary>AsValidatorClass</primary></indexterm>
<programlisting language="C">struct AsValidatorClass {
	GObjectClass		parent_class;
};
</programlisting>
<para>
</para>
</refsect2>
<refsect2 id="AsValidator-struct" role="struct">
<title>AsValidator</title>
<indexterm zone="AsValidator-struct"><primary>AsValidator</primary></indexterm>
<programlisting language="C">typedef struct _AsValidator AsValidator;</programlisting>
<para>
</para>
</refsect2>

</refsect1>

</refentry>
