File: AsDataPool.html

package info (click to toggle)
appstream 0.7.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 7,660 kB
  • ctags: 2,618
  • sloc: xml: 10,142; ansic: 8,362; cpp: 1,905; python: 236; sh: 58; makefile: 13
file content (289 lines) | stat: -rw-r--r-- 14,778 bytes parent folder | download | duplicates (2)
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>AppStream Library Reference Manual: AsDataPool</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="AppStream Library Reference Manual">
<link rel="up" href="ch01.html" title="AppStream API Reference">
<link rel="prev" href="AsMetadata.html" title="AsMetadata">
<link rel="next" href="AsDistroDetails.html" title="AsDistroDetails">
<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#AsDataPool.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#AsDataPool.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="AsMetadata.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="AsDistroDetails.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="AsDataPool"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="AsDataPool.top_of_page"></a>AsDataPool</span></h2>
<p>AsDataPool — Collect and temporarily store metadata from different sources</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="AsDataPool.functions"></a><h2>Functions</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="AsDataPool.html" title="AsDataPool"><span class="returnvalue">AsDataPool</span></a> *
</td>
<td class="function_name">
<a class="link" href="AsDataPool.html#as-data-pool-new" title="as_data_pool_new ()">as_data_pool_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="AsDataPool.html#as-data-pool-initialize" title="as_data_pool_initialize ()">as_data_pool_initialize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> **
</td>
<td class="function_name">
<a class="link" href="AsDataPool.html#as-data-pool-get-watched-locations" title="as_data_pool_get_watched_locations ()">as_data_pool_get_watched_locations</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="AsDataPool.html#as-data-pool-update" title="as_data_pool_update ()">as_data_pool_update</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> *
</td>
<td class="function_name">
<a class="link" href="AsDataPool.html#as-data-pool-get-components" title="as_data_pool_get_components ()">as_data_pool_get_components</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="AsDataPool.html#as-data-pool-get-locale" title="as_data_pool_get_locale ()">as_data_pool_get_locale</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="AsDataPool.html#as-data-pool-set-locale" title="as_data_pool_set_locale ()">as_data_pool_set_locale</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="AsDataPool.html#as-data-pool-set-data-source-directories" title="as_data_pool_set_data_source_directories ()">as_data_pool_set_data_source_directories</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="AsDataPool.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    <a href="../gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
    <span class="lineart">╰──</span> AsDataPool
</pre>
</div>
<div class="refsect1">
<a name="AsDataPool.description"></a><h2>Description</h2>
<p>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 <a class="link" href="AsDatabase.html" title="AsDatabase"><span class="type">AsDatabase</span></a> instance.
This class is used by internally by the cache builder, but might be useful for others.</p>
<p>See also: <a class="link" href="AsDatabase.html" title="AsDatabase"><span class="type">AsDatabase</span></a></p>
</div>
<div class="refsect1">
<a name="AsDataPool.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="as-data-pool-new"></a><h3>as_data_pool_new ()</h3>
<pre class="programlisting"><a class="link" href="AsDataPool.html" title="AsDataPool"><span class="returnvalue">AsDataPool</span></a> *
as_data_pool_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Creates a new <a class="link" href="AsDataPool.html" title="AsDataPool"><span class="type">AsDataPool</span></a>.</p>
<div class="refsect3">
<a name="id-1.2.9.6.2.5"></a><h4>Returns</h4>
<p> a <a class="link" href="AsDataPool.html" title="AsDataPool"><span class="type">AsDataPool</span></a>. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="as-data-pool-initialize"></a><h3>as_data_pool_initialize ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
as_data_pool_initialize (<em class="parameter"><code><a class="link" href="AsDataPool.html" title="AsDataPool"><span class="type">AsDataPool</span></a> *dpool</code></em>);</pre>
<p>Initialize the pool with the predefined metadata locations.</p>
</div>
<hr>
<div class="refsect2">
<a name="as-data-pool-get-watched-locations"></a><h3>as_data_pool_get_watched_locations ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> **
as_data_pool_get_watched_locations (<em class="parameter"><code><a class="link" href="AsDataPool.html" title="AsDataPool"><span class="type">AsDataPool</span></a> *dpool</code></em>);</pre>
<p>Return a list of all locations which are searched for metadata.</p>
<div class="refsect3">
<a name="id-1.2.9.6.4.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>dpool</p></td>
<td class="parameter_description"><p>a valid <a class="link" href="AsDataPool.html" title="AsDataPool"><span class="type">AsDataPool</span></a> instance</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.9.6.4.6"></a><h4>Returns</h4>
<p> A string-list of watched (absolute) filepaths. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="as-data-pool-update"></a><h3>as_data_pool_update ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
as_data_pool_update (<em class="parameter"><code><a class="link" href="AsDataPool.html" title="AsDataPool"><span class="type">AsDataPool</span></a> *dpool</code></em>);</pre>
<p>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 <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, it might still add components to the pool.</p>
<div class="refsect3">
<a name="id-1.2.9.6.5.5"></a><h4>Returns</h4>
<p> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if update completed without error.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="as-data-pool-get-components"></a><h3>as_data_pool_get_components ()</h3>
<pre class="programlisting"><a href="../glib/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> *
as_data_pool_get_components (<em class="parameter"><code><a class="link" href="AsDataPool.html" title="AsDataPool"><span class="type">AsDataPool</span></a> *dpool</code></em>);</pre>
<p>Get a list of found components.</p>
<div class="refsect3">
<a name="id-1.2.9.6.6.5"></a><h4>Returns</h4>
<p> a list of <a class="link" href="AsComponent.html" title="AsComponent"><span class="type">AsComponent</span></a> instances, free with <a href="../glib/glib-Doubly-Linked-Lists.html#g-list-free"><code class="function">g_list_free()</code></a>. </p>
<p><span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> AsComponent][<acronym title="Free data container after the code is done."><span class="acronym">transfer container</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="as-data-pool-get-locale"></a><h3>as_data_pool_get_locale ()</h3>
<pre class="programlisting">const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
as_data_pool_get_locale (<em class="parameter"><code><a class="link" href="AsDataPool.html" title="AsDataPool"><span class="type">AsDataPool</span></a> *dpool</code></em>);</pre>
<p>Gets the currently used locale.</p>
<div class="refsect3">
<a name="id-1.2.9.6.7.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>dpool</p></td>
<td class="parameter_description"><p>a <a class="link" href="AsDataPool.html" title="AsDataPool"><span class="type">AsDataPool</span></a> instance.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.9.6.7.6"></a><h4>Returns</h4>
<p> Locale used for metadata parsing.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="as-data-pool-set-locale"></a><h3>as_data_pool_set_locale ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
as_data_pool_set_locale (<em class="parameter"><code><a class="link" href="AsDataPool.html" title="AsDataPool"><span class="type">AsDataPool</span></a> *dpool</code></em>,
                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *locale</code></em>);</pre>
<p>Sets the current locale which should be used when parsing metadata.</p>
<div class="refsect3">
<a name="id-1.2.9.6.8.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>dpool</p></td>
<td class="parameter_description"><p>a <a class="link" href="AsDataPool.html" title="AsDataPool"><span class="type">AsDataPool</span></a> instance.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>locale</p></td>
<td class="parameter_description"><p>the locale.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="as-data-pool-set-data-source-directories"></a><h3>as_data_pool_set_data_source_directories ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
as_data_pool_set_data_source_directories
                               (<em class="parameter"><code><a class="link" href="AsDataPool.html" title="AsDataPool"><span class="type">AsDataPool</span></a> *dpool</code></em>,
                                <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **dirs</code></em>);</pre>
<p>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.</p>
<div class="refsect3">
<a name="id-1.2.9.6.9.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>dirs</p></td>
<td class="parameter_description"><p> a zero-terminated array of data input directories. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1]</span></td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="AsDataPool.other_details"></a><h2>Types and Values</h2>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.21</div>
</body>
</html>