1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
|
<?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="AsDataPool">
<refmeta>
<refentrytitle role="top_of_page" id="AsDataPool.top_of_page">AsDataPool</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
APPSTREAM Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>AsDataPool</refname>
<refpurpose>Collect and temporarily store metadata from different sources</refpurpose>
</refnamediv>
<refsect1 id="AsDataPool.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="AsDataPool"><returnvalue>AsDataPool</returnvalue></link> *
</entry><entry role="function_name"><link linkend="as-data-pool-new">as_data_pool_new</link> <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-data-pool-initialize">as_data_pool_initialize</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="as-data-pool-get-watched-locations">as_data_pool_get_watched_locations</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="as-data-pool-update">as_data_pool_update</link> <phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GList"><returnvalue>GList</returnvalue></link> *
</entry><entry role="function_name"><link linkend="as-data-pool-get-components">as_data_pool_get_components</link> <phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> *
</entry><entry role="function_name"><link linkend="as-data-pool-get-locale">as_data_pool_get_locale</link> <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-data-pool-set-locale">as_data_pool_set_locale</link> <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-data-pool-set-data-source-directories">as_data_pool_set_data_source_directories</link> <phrase role="c_punctuation">()</phrase></entry></row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="AsDataPool.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen> <link linkend="GObject">GObject</link>
<phrase role="lineart">╰──</phrase> AsDataPool
</screen>
</refsect1>
<refsect1 id="AsDataPool.description" role="desc">
<title role="desc.title">Description</title>
<para>This class contains a temporary pool of metadata which has been collected from different
sources on the system.
It can directly be used, but usually it is accessed through a <link linkend="AsDatabase"><type>AsDatabase</type></link> instance.
This class is used by internally by the cache builder, but might be useful for others.</para>
<para>See also: <link linkend="AsDatabase"><type>AsDatabase</type></link></para>
</refsect1>
<refsect1 id="AsDataPool.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="as-data-pool-new" role="function">
<title>as_data_pool_new ()</title>
<indexterm zone="as-data-pool-new"><primary>as_data_pool_new</primary></indexterm>
<programlisting language="C"><link linkend="AsDataPool"><returnvalue>AsDataPool</returnvalue></link> *
as_data_pool_new (<parameter><type>void</type></parameter>);</programlisting>
<para>Creates a new <link linkend="AsDataPool"><type>AsDataPool</type></link>.</para>
<refsect3 role="returns">
<title>Returns</title>
<para> a <link linkend="AsDataPool"><type>AsDataPool</type></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="as-data-pool-initialize" role="function">
<title>as_data_pool_initialize ()</title>
<indexterm zone="as-data-pool-initialize"><primary>as_data_pool_initialize</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
as_data_pool_initialize (<parameter><link linkend="AsDataPool"><type>AsDataPool</type></link> *dpool</parameter>);</programlisting>
<para>Initialize the pool with the predefined metadata locations.</para>
</refsect2>
<refsect2 id="as-data-pool-get-watched-locations" role="function">
<title>as_data_pool_get_watched_locations ()</title>
<indexterm zone="as-data-pool-get-watched-locations"><primary>as_data_pool_get_watched_locations</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link> **
as_data_pool_get_watched_locations (<parameter><link linkend="AsDataPool"><type>AsDataPool</type></link> *dpool</parameter>);</programlisting>
<para>Return a list of all locations which are searched for 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>dpool</para></entry>
<entry role="parameter_description"><para>a valid <link linkend="AsDataPool"><type>AsDataPool</type></link> instance</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> A string-list of watched (absolute) filepaths. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="as-data-pool-update" role="function">
<title>as_data_pool_update ()</title>
<indexterm zone="as-data-pool-update"><primary>as_data_pool_update</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
as_data_pool_update (<parameter><link linkend="AsDataPool"><type>AsDataPool</type></link> *dpool</parameter>);</programlisting>
<para>Builds an index of all found components in the watched locations.
The function will try to get as much data into the pool as possible, so even if
the updates completes with <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>, it might still add components to the pool.</para>
<refsect3 role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if update completed without error.</para>
<para></para>
</refsect3></refsect2>
<refsect2 id="as-data-pool-get-components" role="function">
<title>as_data_pool_get_components ()</title>
<indexterm zone="as-data-pool-get-components"><primary>as_data_pool_get_components</primary></indexterm>
<programlisting language="C"><link linkend="GList"><returnvalue>GList</returnvalue></link> *
as_data_pool_get_components (<parameter><link linkend="AsDataPool"><type>AsDataPool</type></link> *dpool</parameter>);</programlisting>
<para>Get a list of found components.</para>
<refsect3 role="returns">
<title>Returns</title>
<para> a list of <link linkend="AsComponent"><type>AsComponent</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> AsComponent][<acronym>transfer container</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="as-data-pool-get-locale" role="function">
<title>as_data_pool_get_locale ()</title>
<indexterm zone="as-data-pool-get-locale"><primary>as_data_pool_get_locale</primary></indexterm>
<programlisting language="C">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> *
as_data_pool_get_locale (<parameter><link linkend="AsDataPool"><type>AsDataPool</type></link> *dpool</parameter>);</programlisting>
<para>Gets the currently used locale.</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>dpool</para></entry>
<entry role="parameter_description"><para>a <link linkend="AsDataPool"><type>AsDataPool</type></link> instance.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> Locale used for metadata parsing.</para>
<para></para>
</refsect3></refsect2>
<refsect2 id="as-data-pool-set-locale" role="function">
<title>as_data_pool_set_locale ()</title>
<indexterm zone="as-data-pool-set-locale"><primary>as_data_pool_set_locale</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
as_data_pool_set_locale (<parameter><link linkend="AsDataPool"><type>AsDataPool</type></link> *dpool</parameter>,
<parameter>const <link linkend="gchar"><type>gchar</type></link> *locale</parameter>);</programlisting>
<para>Sets the current locale which should be used when parsing 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>dpool</para></entry>
<entry role="parameter_description"><para>a <link linkend="AsDataPool"><type>AsDataPool</type></link> instance.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>locale</para></entry>
<entry role="parameter_description"><para>the locale.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="as-data-pool-set-data-source-directories" role="function">
<title>as_data_pool_set_data_source_directories ()</title>
<indexterm zone="as-data-pool-set-data-source-directories"><primary>as_data_pool_set_data_source_directories</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
as_data_pool_set_data_source_directories
(<parameter><link linkend="AsDataPool"><type>AsDataPool</type></link> *dpool</parameter>,
<parameter><link linkend="gchar"><type>gchar</type></link> **dirs</parameter>);</programlisting>
<para>Set locations for the data pool to read it's data from.
This is mainly used for testing purposes. Each location should have an
"xmls" and/or "yaml" subdirectory with the actual data as (compressed)
AppStream XML or DEP-11 YAML in it.</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>dirs</para></entry>
<entry role="parameter_description"><para> a zero-terminated array of data input directories. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>array</acronym> zero-terminated=1]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
</refsect1>
<refsect1 id="AsDataPool.other_details" role="details">
<title role="details.title">Types and Values</title>
</refsect1>
</refentry>
|