1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>JSON Array: JSON-GLib Reference Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="index.html" title="JSON-GLib Reference Manual">
8 <link rel="up" href="ch01.html" title="Data Types">
9 <link rel="prev" href="json-glib-JSON-Node.html" title="JSON Node">
10 <link rel="next" href="json-glib-JSON-Object.html" title="JSON Object">
11 <meta name="generator" content="GTK-Doc V1.25.1 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
16 <td width="100%" align="left" class="shortcuts">
17 <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
18 <a href="#json-glib-JSON-Array.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span>
19 <a href="#json-glib-JSON-Array.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
21 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
22 <td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
23 <td><a accesskey="p" href="json-glib-JSON-Node.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
24 <td><a accesskey="n" href="json-glib-JSON-Object.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
26 <div class="refentry">
27 <a name="json-glib-JSON-Array"></a><div class="titlepage"></div>
28 <div class="refnamediv"><table width="100%"><tr>
30 <h2><span class="refentrytitle"><a name="json-glib-JSON-Array.top_of_page"></a>JSON Array</span></h2>
31 <p>JSON Array — a JSON array representation</p>
33 <td class="gallery_image" valign="top" align="right"></td>
35 <div class="refsect1">
36 <a name="json-glib-JSON-Array.functions"></a><h2>Functions</h2>
37 <div class="informaltable"><table class="informaltable" width="100%" border="0">
39 <col width="150px" class="functions_return">
40 <col class="functions_name">
44 <td class="function_type">
45 <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="returnvalue">JsonArray</span></a> *
47 <td class="function_name">
48 <a class="link" href="json-glib-JSON-Array.html#json-array-new" title="json_array_new ()">json_array_new</a> <span class="c_punctuation">()</span>
52 <td class="function_type">
53 <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="returnvalue">JsonArray</span></a> *
55 <td class="function_name">
56 <a class="link" href="json-glib-JSON-Array.html#json-array-sized-new" title="json_array_sized_new ()">json_array_sized_new</a> <span class="c_punctuation">()</span>
60 <td class="function_type">
61 <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="returnvalue">JsonArray</span></a> *
63 <td class="function_name">
64 <a class="link" href="json-glib-JSON-Array.html#json-array-ref" title="json_array_ref ()">json_array_ref</a> <span class="c_punctuation">()</span>
68 <td class="function_type">
69 <span class="returnvalue">void</span>
71 <td class="function_name">
72 <a class="link" href="json-glib-JSON-Array.html#json-array-unref" title="json_array_unref ()">json_array_unref</a> <span class="c_punctuation">()</span>
76 <td class="function_type">
77 <span class="returnvalue">void</span>
79 <td class="function_name">
80 <a class="link" href="json-glib-JSON-Array.html#json-array-seal" title="json_array_seal ()">json_array_seal</a> <span class="c_punctuation">()</span>
84 <td class="function_type">
85 <span class="returnvalue">gboolean</span>
87 <td class="function_name">
88 <a class="link" href="json-glib-JSON-Array.html#json-array-is-immutable" title="json_array_is_immutable ()">json_array_is_immutable</a> <span class="c_punctuation">()</span>
92 <td class="function_type">
93 <span class="returnvalue">guint</span>
95 <td class="function_name">
96 <a class="link" href="json-glib-JSON-Array.html#json-array-hash" title="json_array_hash ()">json_array_hash</a> <span class="c_punctuation">()</span>
100 <td class="function_type">
101 <span class="returnvalue">gboolean</span>
103 <td class="function_name">
104 <a class="link" href="json-glib-JSON-Array.html#json-array-equal" title="json_array_equal ()">json_array_equal</a> <span class="c_punctuation">()</span>
108 <td class="function_type">
109 <span class="returnvalue">void</span>
111 <td class="function_name">
112 <a class="link" href="json-glib-JSON-Array.html#json-array-add-element" title="json_array_add_element ()">json_array_add_element</a> <span class="c_punctuation">()</span>
116 <td class="function_type">
117 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
119 <td class="function_name">
120 <a class="link" href="json-glib-JSON-Array.html#json-array-get-element" title="json_array_get_element ()">json_array_get_element</a> <span class="c_punctuation">()</span>
124 <td class="function_type">
125 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
127 <td class="function_name">
128 <a class="link" href="json-glib-JSON-Array.html#json-array-dup-element" title="json_array_dup_element ()">json_array_dup_element</a> <span class="c_punctuation">()</span>
132 <td class="function_type">
133 <span class="returnvalue">GList</span> *
135 <td class="function_name">
136 <a class="link" href="json-glib-JSON-Array.html#json-array-get-elements" title="json_array_get_elements ()">json_array_get_elements</a> <span class="c_punctuation">()</span>
140 <td class="function_type">
141 <span class="returnvalue">guint</span>
143 <td class="function_name">
144 <a class="link" href="json-glib-JSON-Array.html#json-array-get-length" title="json_array_get_length ()">json_array_get_length</a> <span class="c_punctuation">()</span>
148 <td class="function_type">
149 <span class="returnvalue">void</span>
151 <td class="function_name">
152 <a class="link" href="json-glib-JSON-Array.html#json-array-remove-element" title="json_array_remove_element ()">json_array_remove_element</a> <span class="c_punctuation">()</span>
156 <td class="function_type">
157 <span class="returnvalue">void</span>
159 <td class="function_name">
160 <span class="c_punctuation">(</span><a class="link" href="json-glib-JSON-Array.html#JsonArrayForeach" title="JsonArrayForeach ()">*JsonArrayForeach</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
164 <td class="function_type">
165 <span class="returnvalue">void</span>
167 <td class="function_name">
168 <a class="link" href="json-glib-JSON-Array.html#json-array-foreach-element" title="json_array_foreach_element ()">json_array_foreach_element</a> <span class="c_punctuation">()</span>
172 <td class="function_type">
173 <span class="returnvalue">void</span>
175 <td class="function_name">
176 <a class="link" href="json-glib-JSON-Array.html#json-array-add-array-element" title="json_array_add_array_element ()">json_array_add_array_element</a> <span class="c_punctuation">()</span>
180 <td class="function_type">
181 <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="returnvalue">JsonArray</span></a> *
183 <td class="function_name">
184 <a class="link" href="json-glib-JSON-Array.html#json-array-get-array-element" title="json_array_get_array_element ()">json_array_get_array_element</a> <span class="c_punctuation">()</span>
188 <td class="function_type">
189 <span class="returnvalue">void</span>
191 <td class="function_name">
192 <a class="link" href="json-glib-JSON-Array.html#json-array-add-boolean-element" title="json_array_add_boolean_element ()">json_array_add_boolean_element</a> <span class="c_punctuation">()</span>
196 <td class="function_type">
197 <span class="returnvalue">gboolean</span>
199 <td class="function_name">
200 <a class="link" href="json-glib-JSON-Array.html#json-array-get-boolean-element" title="json_array_get_boolean_element ()">json_array_get_boolean_element</a> <span class="c_punctuation">()</span>
204 <td class="function_type">
205 <span class="returnvalue">void</span>
207 <td class="function_name">
208 <a class="link" href="json-glib-JSON-Array.html#json-array-add-double-element" title="json_array_add_double_element ()">json_array_add_double_element</a> <span class="c_punctuation">()</span>
212 <td class="function_type">
213 <span class="returnvalue">gdouble</span>
215 <td class="function_name">
216 <a class="link" href="json-glib-JSON-Array.html#json-array-get-double-element" title="json_array_get_double_element ()">json_array_get_double_element</a> <span class="c_punctuation">()</span>
220 <td class="function_type">
221 <span class="returnvalue">void</span>
223 <td class="function_name">
224 <a class="link" href="json-glib-JSON-Array.html#json-array-add-int-element" title="json_array_add_int_element ()">json_array_add_int_element</a> <span class="c_punctuation">()</span>
228 <td class="function_type">
229 <span class="returnvalue">gint64</span>
231 <td class="function_name">
232 <a class="link" href="json-glib-JSON-Array.html#json-array-get-int-element" title="json_array_get_int_element ()">json_array_get_int_element</a> <span class="c_punctuation">()</span>
236 <td class="function_type">
237 <span class="returnvalue">void</span>
239 <td class="function_name">
240 <a class="link" href="json-glib-JSON-Array.html#json-array-add-null-element" title="json_array_add_null_element ()">json_array_add_null_element</a> <span class="c_punctuation">()</span>
244 <td class="function_type">
245 <span class="returnvalue">gboolean</span>
247 <td class="function_name">
248 <a class="link" href="json-glib-JSON-Array.html#json-array-get-null-element" title="json_array_get_null_element ()">json_array_get_null_element</a> <span class="c_punctuation">()</span>
252 <td class="function_type">
253 <span class="returnvalue">void</span>
255 <td class="function_name">
256 <a class="link" href="json-glib-JSON-Array.html#json-array-add-object-element" title="json_array_add_object_element ()">json_array_add_object_element</a> <span class="c_punctuation">()</span>
260 <td class="function_type">
261 <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="returnvalue">JsonObject</span></a> *
263 <td class="function_name">
264 <a class="link" href="json-glib-JSON-Array.html#json-array-get-object-element" title="json_array_get_object_element ()">json_array_get_object_element</a> <span class="c_punctuation">()</span>
268 <td class="function_type">
269 <span class="returnvalue">void</span>
271 <td class="function_name">
272 <a class="link" href="json-glib-JSON-Array.html#json-array-add-string-element" title="json_array_add_string_element ()">json_array_add_string_element</a> <span class="c_punctuation">()</span>
276 <td class="function_type">const <span class="returnvalue">gchar</span> *
278 <td class="function_name">
279 <a class="link" href="json-glib-JSON-Array.html#json-array-get-string-element" title="json_array_get_string_element ()">json_array_get_string_element</a> <span class="c_punctuation">()</span>
285 <a name="JsonArray"></a><div class="refsect1">
286 <a name="json-glib-JSON-Array.other"></a><h2>Types and Values</h2>
287 <div class="informaltable"><table class="informaltable" width="100%" border="0">
289 <col width="150px" class="name">
290 <col class="description">
293 <td class="datatype_keyword"> </td>
294 <td class="function_name"><a class="link" href="json-glib-JSON-Array.html#JsonArray-struct" title="JsonArray">JsonArray</a></td>
298 <div class="refsect1">
299 <a name="json-glib-JSON-Array.object-hierarchy"></a><h2>Object Hierarchy</h2>
300 <pre class="screen"> <a href="/home/ebassi/gnome/install/share/gtk-doc/html/gobject/gobject-Boxed-Types.html">GBoxed</a>
301 <span class="lineart">╰──</span> JsonArray
304 <div class="refsect1">
305 <a name="json-glib-JSON-Array.description"></a><h2>Description</h2>
306 <p><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> is the representation of the array type inside JSON. It contains
307 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> elements, which may contain fundamental types, other arrays or
309 <p>Since arrays can be expensive, they are reference counted. You can control
310 the lifetime of a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> using <a class="link" href="json-glib-JSON-Array.html#json-array-ref" title="json_array_ref ()"><code class="function">json_array_ref()</code></a> and <a class="link" href="json-glib-JSON-Array.html#json-array-unref" title="json_array_unref ()"><code class="function">json_array_unref()</code></a>.</p>
311 <p>To append an element, use <a class="link" href="json-glib-JSON-Array.html#json-array-add-element" title="json_array_add_element ()"><code class="function">json_array_add_element()</code></a>.
312 To extract an element at a given index, use <a class="link" href="json-glib-JSON-Array.html#json-array-get-element" title="json_array_get_element ()"><code class="function">json_array_get_element()</code></a>.
313 To retrieve the entire array in list form, use <a class="link" href="json-glib-JSON-Array.html#json-array-get-elements" title="json_array_get_elements ()"><code class="function">json_array_get_elements()</code></a>.
314 To retrieve the length of the array, use <a class="link" href="json-glib-JSON-Array.html#json-array-get-length" title="json_array_get_length ()"><code class="function">json_array_get_length()</code></a>.</p>
316 <div class="refsect1">
317 <a name="json-glib-JSON-Array.functions_details"></a><h2>Functions</h2>
318 <div class="refsect2">
319 <a name="json-array-new"></a><h3>json_array_new ()</h3>
320 <pre class="programlisting"><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="returnvalue">JsonArray</span></a> *
321 json_array_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
322 <p>Creates a new <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a>.</p>
323 <p><span class="annotation">[<acronym title="This symbol is a constructor, not a static method."><span class="acronym">constructor</span></acronym>]</span></p>
324 <div class="refsect3">
325 <a name="json-array-new.returns"></a><h4>Returns</h4>
326 <p> the newly created <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a>. </p>
327 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
331 <div class="refsect2">
332 <a name="json-array-sized-new"></a><h3>json_array_sized_new ()</h3>
333 <pre class="programlisting"><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="returnvalue">JsonArray</span></a> *
334 json_array_sized_new (<em class="parameter"><code><span class="type">guint</span> n_elements</code></em>);</pre>
335 <p>Creates a new <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> with <em class="parameter"><code>n_elements</code></em>
336 slots already allocated.</p>
337 <p><span class="annotation">[<acronym title="This symbol is a constructor, not a static method."><span class="acronym">constructor</span></acronym>]</span></p>
338 <div class="refsect3">
339 <a name="json-array-sized-new.parameters"></a><h4>Parameters</h4>
340 <div class="informaltable"><table class="informaltable" width="100%" border="0">
342 <col width="150px" class="parameters_name">
343 <col class="parameters_description">
344 <col width="200px" class="parameters_annotations">
347 <td class="parameter_name"><p>n_elements</p></td>
348 <td class="parameter_description"><p>number of slots to pre-allocate</p></td>
349 <td class="parameter_annotations"> </td>
353 <div class="refsect3">
354 <a name="json-array-sized-new.returns"></a><h4>Returns</h4>
355 <p> the newly created <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a>. </p>
356 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
360 <div class="refsect2">
361 <a name="json-array-ref"></a><h3>json_array_ref ()</h3>
362 <pre class="programlisting"><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="returnvalue">JsonArray</span></a> *
363 json_array_ref (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>);</pre>
364 <p>Increase by one the reference count of a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a>.</p>
365 <div class="refsect3">
366 <a name="json-array-ref.parameters"></a><h4>Parameters</h4>
367 <div class="informaltable"><table class="informaltable" width="100%" border="0">
369 <col width="150px" class="parameters_name">
370 <col class="parameters_description">
371 <col width="200px" class="parameters_annotations">
374 <td class="parameter_name"><p>array</p></td>
375 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
376 <td class="parameter_annotations"> </td>
380 <div class="refsect3">
381 <a name="json-array-ref.returns"></a><h4>Returns</h4>
382 <p> the passed <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a>, with the reference count
383 increased by one. </p>
384 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
388 <div class="refsect2">
389 <a name="json-array-unref"></a><h3>json_array_unref ()</h3>
390 <pre class="programlisting"><span class="returnvalue">void</span>
391 json_array_unref (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>);</pre>
392 <p>Decreases by one the reference count of a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a>. If the
393 reference count reaches zero, the array is destroyed and all
394 its allocated resources are freed.</p>
395 <div class="refsect3">
396 <a name="json-array-unref.parameters"></a><h4>Parameters</h4>
397 <div class="informaltable"><table class="informaltable" width="100%" border="0">
399 <col width="150px" class="parameters_name">
400 <col class="parameters_description">
401 <col width="200px" class="parameters_annotations">
404 <td class="parameter_name"><p>array</p></td>
405 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
406 <td class="parameter_annotations"> </td>
412 <div class="refsect2">
413 <a name="json-array-seal"></a><h3>json_array_seal ()</h3>
414 <pre class="programlisting"><span class="returnvalue">void</span>
415 json_array_seal (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>);</pre>
416 <p>Seals the <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a>, making it immutable to further changes. This will
417 recursively seal all elements in the array too.</p>
418 <p>If the <em class="parameter"><code>array</code></em>
419 is already immutable, this is a no-op.</p>
420 <div class="refsect3">
421 <a name="json-array-seal.parameters"></a><h4>Parameters</h4>
422 <div class="informaltable"><table class="informaltable" width="100%" border="0">
424 <col width="150px" class="parameters_name">
425 <col class="parameters_description">
426 <col width="200px" class="parameters_annotations">
429 <td class="parameter_name"><p>array</p></td>
430 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
431 <td class="parameter_annotations"> </td>
435 <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p>
438 <div class="refsect2">
439 <a name="json-array-is-immutable"></a><h3>json_array_is_immutable ()</h3>
440 <pre class="programlisting"><span class="returnvalue">gboolean</span>
441 json_array_is_immutable (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>);</pre>
442 <p>Check whether the given <em class="parameter"><code>array</code></em>
443 has been marked as immutable by calling
444 <a class="link" href="json-glib-JSON-Array.html#json-array-seal" title="json_array_seal ()"><code class="function">json_array_seal()</code></a> on it.</p>
445 <div class="refsect3">
446 <a name="json-array-is-immutable.parameters"></a><h4>Parameters</h4>
447 <div class="informaltable"><table class="informaltable" width="100%" border="0">
449 <col width="150px" class="parameters_name">
450 <col class="parameters_description">
451 <col width="200px" class="parameters_annotations">
454 <td class="parameter_name"><p>array</p></td>
455 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
456 <td class="parameter_annotations"> </td>
460 <div class="refsect3">
461 <a name="json-array-is-immutable.returns"></a><h4>Returns</h4>
462 <p> <code class="literal">TRUE</code> if the <em class="parameter"><code>array</code></em>
465 <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p>
468 <div class="refsect2">
469 <a name="json-array-hash"></a><h3>json_array_hash ()</h3>
470 <pre class="programlisting"><span class="returnvalue">guint</span>
471 json_array_hash (<em class="parameter"><code><span class="type">gconstpointer</span> key</code></em>);</pre>
472 <p>Calculate a hash value for the given <em class="parameter"><code>key</code></em>
473 (a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a>).</p>
474 <p>The hash is calculated over the array and all its elements, recursively. If
475 the array is immutable, this is a fast operation; otherwise, it scales
476 proportionally with the length of the array.</p>
477 <div class="refsect3">
478 <a name="json-array-hash.parameters"></a><h4>Parameters</h4>
479 <div class="informaltable"><table class="informaltable" width="100%" border="0">
481 <col width="150px" class="parameters_name">
482 <col class="parameters_description">
483 <col width="200px" class="parameters_annotations">
486 <td class="parameter_name"><p>key</p></td>
487 <td class="parameter_description"><p> a JSON array to hash. </p></td>
488 <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> JsonArray]</span></td>
492 <div class="refsect3">
493 <a name="json-array-hash.returns"></a><h4>Returns</h4>
494 <p> hash value for <em class="parameter"><code>key</code></em>
497 <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p>
500 <div class="refsect2">
501 <a name="json-array-equal"></a><h3>json_array_equal ()</h3>
502 <pre class="programlisting"><span class="returnvalue">gboolean</span>
503 json_array_equal (<em class="parameter"><code><span class="type">gconstpointer</span> a</code></em>,
504 <em class="parameter"><code><span class="type">gconstpointer</span> b</code></em>);</pre>
505 <p>Check whether <em class="parameter"><code>a</code></em>
506 and <em class="parameter"><code>b</code></em>
507 are equal <a href="json-glib-JSON-Array.html#JsonArray-struct"><span class="type">JsonArrays</span></a>, meaning they have the same
508 number of elements, and the values of elements in corresponding positions
510 <div class="refsect3">
511 <a name="json-array-equal.parameters"></a><h4>Parameters</h4>
512 <div class="informaltable"><table class="informaltable" width="100%" border="0">
514 <col width="150px" class="parameters_name">
515 <col class="parameters_description">
516 <col width="200px" class="parameters_annotations">
520 <td class="parameter_name"><p>a</p></td>
521 <td class="parameter_description"><p> a JSON array. </p></td>
522 <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> JsonArray]</span></td>
525 <td class="parameter_name"><p>b</p></td>
526 <td class="parameter_description"><p> another JSON array. </p></td>
527 <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> JsonArray]</span></td>
532 <div class="refsect3">
533 <a name="json-array-equal.returns"></a><h4>Returns</h4>
534 <p> <code class="literal">TRUE</code> if <em class="parameter"><code>a</code></em>
535 and <em class="parameter"><code>b</code></em>
536 are equal; <code class="literal">FALSE</code> otherwise</p>
538 <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p>
541 <div class="refsect2">
542 <a name="json-array-add-element"></a><h3>json_array_add_element ()</h3>
543 <pre class="programlisting"><span class="returnvalue">void</span>
544 json_array_add_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
545 <em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre>
546 <p>Appends <em class="parameter"><code>node</code></em>
547 inside <em class="parameter"><code>array</code></em>
548 . The array will take ownership of the
549 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>.</p>
550 <div class="refsect3">
551 <a name="json-array-add-element.parameters"></a><h4>Parameters</h4>
552 <div class="informaltable"><table class="informaltable" width="100%" border="0">
554 <col width="150px" class="parameters_name">
555 <col class="parameters_description">
556 <col width="200px" class="parameters_annotations">
560 <td class="parameter_name"><p>array</p></td>
561 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
562 <td class="parameter_annotations"> </td>
565 <td class="parameter_name"><p>node</p></td>
566 <td class="parameter_description"><p> a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p></td>
567 <td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
574 <div class="refsect2">
575 <a name="json-array-get-element"></a><h3>json_array_get_element ()</h3>
576 <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
577 json_array_get_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
578 <em class="parameter"><code><span class="type">guint</span> index_</code></em>);</pre>
579 <p>Retrieves the <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> containing the value of the element at <em class="parameter"><code>index_</code></em>
581 inside a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a>.</p>
582 <div class="refsect3">
583 <a name="json-array-get-element.parameters"></a><h4>Parameters</h4>
584 <div class="informaltable"><table class="informaltable" width="100%" border="0">
586 <col width="150px" class="parameters_name">
587 <col class="parameters_description">
588 <col width="200px" class="parameters_annotations">
592 <td class="parameter_name"><p>array</p></td>
593 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
594 <td class="parameter_annotations"> </td>
597 <td class="parameter_name"><p>index_</p></td>
598 <td class="parameter_description"><p>the index of the element to retrieve</p></td>
599 <td class="parameter_annotations"> </td>
604 <div class="refsect3">
605 <a name="json-array-get-element.returns"></a><h4>Returns</h4>
606 <p> a pointer to the <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> at the requested index. </p>
607 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
611 <div class="refsect2">
612 <a name="json-array-dup-element"></a><h3>json_array_dup_element ()</h3>
613 <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
614 json_array_dup_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
615 <em class="parameter"><code><span class="type">guint</span> index_</code></em>);</pre>
616 <p>Retrieves a copy of the <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> containing the value of the
617 element at <em class="parameter"><code>index_</code></em>
618 inside a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p>
619 <div class="refsect3">
620 <a name="json-array-dup-element.parameters"></a><h4>Parameters</h4>
621 <div class="informaltable"><table class="informaltable" width="100%" border="0">
623 <col width="150px" class="parameters_name">
624 <col class="parameters_description">
625 <col width="200px" class="parameters_annotations">
629 <td class="parameter_name"><p>array</p></td>
630 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
631 <td class="parameter_annotations"> </td>
634 <td class="parameter_name"><p>index_</p></td>
635 <td class="parameter_description"><p>the index of the element to retrieve</p></td>
636 <td class="parameter_annotations"> </td>
641 <div class="refsect3">
642 <a name="json-array-dup-element.returns"></a><h4>Returns</h4>
643 <p> a copy of the <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> at the requested
644 index. Use <a class="link" href="json-glib-JSON-Node.html#json-node-unref" title="json_node_unref ()"><code class="function">json_node_unref()</code></a> when done. </p>
645 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
647 <p class="since">Since: <a class="link" href="ix04.html#api-index-0.6">0.6</a></p>
650 <div class="refsect2">
651 <a name="json-array-get-elements"></a><h3>json_array_get_elements ()</h3>
652 <pre class="programlisting"><span class="returnvalue">GList</span> *
653 json_array_get_elements (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>);</pre>
654 <p>Gets the elements of a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> as a list of <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> instances.</p>
655 <div class="refsect3">
656 <a name="json-array-get-elements.parameters"></a><h4>Parameters</h4>
657 <div class="informaltable"><table class="informaltable" width="100%" border="0">
659 <col width="150px" class="parameters_name">
660 <col class="parameters_description">
661 <col width="200px" class="parameters_annotations">
664 <td class="parameter_name"><p>array</p></td>
665 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
666 <td class="parameter_annotations"> </td>
670 <div class="refsect3">
671 <a name="json-array-get-elements.returns"></a><h4>Returns</h4>
672 <p> a <span class="type">GList</span>
673 containing the elements of the array. The contents of the list are
674 owned by the array and should never be modified or freed. Use
675 <code class="function">g_list_free()</code> on the returned list when done using it. </p>
676 <p><span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> JsonNode][<acronym title="Free data container after the code is done."><span class="acronym">transfer container</span></acronym>]</span></p>
680 <div class="refsect2">
681 <a name="json-array-get-length"></a><h3>json_array_get_length ()</h3>
682 <pre class="programlisting"><span class="returnvalue">guint</span>
683 json_array_get_length (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>);</pre>
684 <p>Retrieves the length of a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p>
685 <div class="refsect3">
686 <a name="json-array-get-length.parameters"></a><h4>Parameters</h4>
687 <div class="informaltable"><table class="informaltable" width="100%" border="0">
689 <col width="150px" class="parameters_name">
690 <col class="parameters_description">
691 <col width="200px" class="parameters_annotations">
694 <td class="parameter_name"><p>array</p></td>
695 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
696 <td class="parameter_annotations"> </td>
700 <div class="refsect3">
701 <a name="json-array-get-length.returns"></a><h4>Returns</h4>
702 <p> the length of the array</p>
706 <div class="refsect2">
707 <a name="json-array-remove-element"></a><h3>json_array_remove_element ()</h3>
708 <pre class="programlisting"><span class="returnvalue">void</span>
709 json_array_remove_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
710 <em class="parameter"><code><span class="type">guint</span> index_</code></em>);</pre>
711 <p>Removes the <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> inside <em class="parameter"><code>array</code></em>
712 at <em class="parameter"><code>index_</code></em>
713 freeing its allocated
715 <div class="refsect3">
716 <a name="json-array-remove-element.parameters"></a><h4>Parameters</h4>
717 <div class="informaltable"><table class="informaltable" width="100%" border="0">
719 <col width="150px" class="parameters_name">
720 <col class="parameters_description">
721 <col width="200px" class="parameters_annotations">
725 <td class="parameter_name"><p>array</p></td>
726 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
727 <td class="parameter_annotations"> </td>
730 <td class="parameter_name"><p>index_</p></td>
731 <td class="parameter_description"><p>the position of the element to be removed</p></td>
732 <td class="parameter_annotations"> </td>
739 <div class="refsect2">
740 <a name="JsonArrayForeach"></a><h3>JsonArrayForeach ()</h3>
741 <pre class="programlisting"><span class="returnvalue">void</span>
742 <span class="c_punctuation">(</span>*JsonArrayForeach<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
743 <em class="parameter"><code><span class="type">guint</span> index_</code></em>,
744 <em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *element_node</code></em>,
745 <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre>
746 <p>The function to be passed to <a class="link" href="json-glib-JSON-Array.html#json-array-foreach-element" title="json_array_foreach_element ()"><code class="function">json_array_foreach_element()</code></a>. You
747 should not add or remove elements to and from <em class="parameter"><code>array</code></em>
749 this function. It is safe to change the value of <em class="parameter"><code>element_node</code></em>
751 <div class="refsect3">
752 <a name="JsonArrayForeach.parameters"></a><h4>Parameters</h4>
753 <div class="informaltable"><table class="informaltable" width="100%" border="0">
755 <col width="150px" class="parameters_name">
756 <col class="parameters_description">
757 <col width="200px" class="parameters_annotations">
761 <td class="parameter_name"><p>array</p></td>
762 <td class="parameter_description"><p>the iterated <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
763 <td class="parameter_annotations"> </td>
766 <td class="parameter_name"><p>index_</p></td>
767 <td class="parameter_description"><p>the index of the element</p></td>
768 <td class="parameter_annotations"> </td>
771 <td class="parameter_name"><p>element_node</p></td>
772 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> containing the value at <em class="parameter"><code>index_</code></em>
774 <td class="parameter_annotations"> </td>
777 <td class="parameter_name"><p>user_data</p></td>
778 <td class="parameter_description"><p>data passed to the function</p></td>
779 <td class="parameter_annotations"> </td>
784 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
787 <div class="refsect2">
788 <a name="json-array-foreach-element"></a><h3>json_array_foreach_element ()</h3>
789 <pre class="programlisting"><span class="returnvalue">void</span>
790 json_array_foreach_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
791 <em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArrayForeach" title="JsonArrayForeach ()"><span class="type">JsonArrayForeach</span></a> func</code></em>,
792 <em class="parameter"><code><span class="type">gpointer</span> data</code></em>);</pre>
793 <p>Iterates over all elements of <em class="parameter"><code>array</code></em>
794 and calls <em class="parameter"><code>func</code></em>
796 each one of them.</p>
797 <p>It is safe to change the value of a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> of the <em class="parameter"><code>array</code></em>
799 from within the iterator <em class="parameter"><code>func</code></em>
800 , but it is not safe to add or
801 remove elements from the <em class="parameter"><code>array</code></em>
803 <div class="refsect3">
804 <a name="json-array-foreach-element.parameters"></a><h4>Parameters</h4>
805 <div class="informaltable"><table class="informaltable" width="100%" border="0">
807 <col width="150px" class="parameters_name">
808 <col class="parameters_description">
809 <col width="200px" class="parameters_annotations">
813 <td class="parameter_name"><p>array</p></td>
814 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
815 <td class="parameter_annotations"> </td>
818 <td class="parameter_name"><p>func</p></td>
819 <td class="parameter_description"><p> the function to be called on each element. </p></td>
820 <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid only during the call to the method."><span class="acronym">scope call</span></acronym>]</span></td>
823 <td class="parameter_name"><p>data</p></td>
824 <td class="parameter_description"><p> data to be passed to the function. </p></td>
825 <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
830 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
833 <div class="refsect2">
834 <a name="json-array-add-array-element"></a><h3>json_array_add_array_element ()</h3>
835 <pre class="programlisting"><span class="returnvalue">void</span>
836 json_array_add_array_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
837 <em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *value</code></em>);</pre>
838 <p>Conveniently adds an array into <em class="parameter"><code>array</code></em>
839 . The <em class="parameter"><code>array</code></em>
841 of the newly added <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p>
842 <p>See also: <a class="link" href="json-glib-JSON-Array.html#json-array-add-element" title="json_array_add_element ()"><code class="function">json_array_add_element()</code></a>, <a class="link" href="json-glib-JSON-Node.html#json-node-take-array" title="json_node_take_array ()"><code class="function">json_node_take_array()</code></a></p>
843 <div class="refsect3">
844 <a name="json-array-add-array-element.parameters"></a><h4>Parameters</h4>
845 <div class="informaltable"><table class="informaltable" width="100%" border="0">
847 <col width="150px" class="parameters_name">
848 <col class="parameters_description">
849 <col width="200px" class="parameters_annotations">
853 <td class="parameter_name"><p>array</p></td>
854 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
855 <td class="parameter_annotations"> </td>
858 <td class="parameter_name"><p>value</p></td>
859 <td class="parameter_description"><p> a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a>. </p></td>
860 <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
865 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
868 <div class="refsect2">
869 <a name="json-array-get-array-element"></a><h3>json_array_get_array_element ()</h3>
870 <pre class="programlisting"><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="returnvalue">JsonArray</span></a> *
871 json_array_get_array_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
872 <em class="parameter"><code><span class="type">guint</span> index_</code></em>);</pre>
873 <p>Conveniently retrieves the array from the element at <em class="parameter"><code>index_</code></em>
875 inside <em class="parameter"><code>array</code></em>
877 <p>See also: <a class="link" href="json-glib-JSON-Array.html#json-array-get-element" title="json_array_get_element ()"><code class="function">json_array_get_element()</code></a>, <a class="link" href="json-glib-JSON-Node.html#json-node-get-array" title="json_node_get_array ()"><code class="function">json_node_get_array()</code></a></p>
878 <div class="refsect3">
879 <a name="json-array-get-array-element.parameters"></a><h4>Parameters</h4>
880 <div class="informaltable"><table class="informaltable" width="100%" border="0">
882 <col width="150px" class="parameters_name">
883 <col class="parameters_description">
884 <col width="200px" class="parameters_annotations">
888 <td class="parameter_name"><p>array</p></td>
889 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
890 <td class="parameter_annotations"> </td>
893 <td class="parameter_name"><p>index_</p></td>
894 <td class="parameter_description"><p>the index of the element to retrieve</p></td>
895 <td class="parameter_annotations"> </td>
900 <div class="refsect3">
901 <a name="json-array-get-array-element.returns"></a><h4>Returns</h4>
903 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
905 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
908 <div class="refsect2">
909 <a name="json-array-add-boolean-element"></a><h3>json_array_add_boolean_element ()</h3>
910 <pre class="programlisting"><span class="returnvalue">void</span>
911 json_array_add_boolean_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
912 <em class="parameter"><code><span class="type">gboolean</span> value</code></em>);</pre>
913 <p>Conveniently adds a boolean <em class="parameter"><code>value</code></em>
914 into <em class="parameter"><code>array</code></em>
916 <p>See also: <a class="link" href="json-glib-JSON-Array.html#json-array-add-element" title="json_array_add_element ()"><code class="function">json_array_add_element()</code></a>, <a class="link" href="json-glib-JSON-Node.html#json-node-set-boolean" title="json_node_set_boolean ()"><code class="function">json_node_set_boolean()</code></a></p>
917 <div class="refsect3">
918 <a name="json-array-add-boolean-element.parameters"></a><h4>Parameters</h4>
919 <div class="informaltable"><table class="informaltable" width="100%" border="0">
921 <col width="150px" class="parameters_name">
922 <col class="parameters_description">
923 <col width="200px" class="parameters_annotations">
927 <td class="parameter_name"><p>array</p></td>
928 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
929 <td class="parameter_annotations"> </td>
932 <td class="parameter_name"><p>value</p></td>
933 <td class="parameter_description"><p>a boolean value</p></td>
934 <td class="parameter_annotations"> </td>
939 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
942 <div class="refsect2">
943 <a name="json-array-get-boolean-element"></a><h3>json_array_get_boolean_element ()</h3>
944 <pre class="programlisting"><span class="returnvalue">gboolean</span>
945 json_array_get_boolean_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
946 <em class="parameter"><code><span class="type">guint</span> index_</code></em>);</pre>
947 <p>Conveniently retrieves the boolean value of the element at <em class="parameter"><code>index_</code></em>
949 inside <em class="parameter"><code>array</code></em>
951 <p>See also: <a class="link" href="json-glib-JSON-Array.html#json-array-get-element" title="json_array_get_element ()"><code class="function">json_array_get_element()</code></a>, <a class="link" href="json-glib-JSON-Node.html#json-node-get-boolean" title="json_node_get_boolean ()"><code class="function">json_node_get_boolean()</code></a></p>
952 <div class="refsect3">
953 <a name="json-array-get-boolean-element.parameters"></a><h4>Parameters</h4>
954 <div class="informaltable"><table class="informaltable" width="100%" border="0">
956 <col width="150px" class="parameters_name">
957 <col class="parameters_description">
958 <col width="200px" class="parameters_annotations">
962 <td class="parameter_name"><p>array</p></td>
963 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
964 <td class="parameter_annotations"> </td>
967 <td class="parameter_name"><p>index_</p></td>
968 <td class="parameter_description"><p>the index of the element to retrieve</p></td>
969 <td class="parameter_annotations"> </td>
974 <div class="refsect3">
975 <a name="json-array-get-boolean-element.returns"></a><h4>Returns</h4>
976 <p> the integer value</p>
978 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
981 <div class="refsect2">
982 <a name="json-array-add-double-element"></a><h3>json_array_add_double_element ()</h3>
983 <pre class="programlisting"><span class="returnvalue">void</span>
984 json_array_add_double_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
985 <em class="parameter"><code><span class="type">gdouble</span> value</code></em>);</pre>
986 <p>Conveniently adds a floating point <em class="parameter"><code>value</code></em>
987 into <em class="parameter"><code>array</code></em>
989 <p>See also: <a class="link" href="json-glib-JSON-Array.html#json-array-add-element" title="json_array_add_element ()"><code class="function">json_array_add_element()</code></a>, <a class="link" href="json-glib-JSON-Node.html#json-node-set-double" title="json_node_set_double ()"><code class="function">json_node_set_double()</code></a></p>
990 <div class="refsect3">
991 <a name="json-array-add-double-element.parameters"></a><h4>Parameters</h4>
992 <div class="informaltable"><table class="informaltable" width="100%" border="0">
994 <col width="150px" class="parameters_name">
995 <col class="parameters_description">
996 <col width="200px" class="parameters_annotations">
1000 <td class="parameter_name"><p>array</p></td>
1001 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
1002 <td class="parameter_annotations"> </td>
1005 <td class="parameter_name"><p>value</p></td>
1006 <td class="parameter_description"><p>a floating point value</p></td>
1007 <td class="parameter_annotations"> </td>
1012 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
1015 <div class="refsect2">
1016 <a name="json-array-get-double-element"></a><h3>json_array_get_double_element ()</h3>
1017 <pre class="programlisting"><span class="returnvalue">gdouble</span>
1018 json_array_get_double_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
1019 <em class="parameter"><code><span class="type">guint</span> index_</code></em>);</pre>
1020 <p>Conveniently retrieves the floating point value of the element at
1021 <em class="parameter"><code>index_</code></em>
1022 inside <em class="parameter"><code>array</code></em>
1024 <p>See also: <a class="link" href="json-glib-JSON-Array.html#json-array-get-element" title="json_array_get_element ()"><code class="function">json_array_get_element()</code></a>, <a class="link" href="json-glib-JSON-Node.html#json-node-get-double" title="json_node_get_double ()"><code class="function">json_node_get_double()</code></a></p>
1025 <div class="refsect3">
1026 <a name="json-array-get-double-element.parameters"></a><h4>Parameters</h4>
1027 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1029 <col width="150px" class="parameters_name">
1030 <col class="parameters_description">
1031 <col width="200px" class="parameters_annotations">
1035 <td class="parameter_name"><p>array</p></td>
1036 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
1037 <td class="parameter_annotations"> </td>
1040 <td class="parameter_name"><p>index_</p></td>
1041 <td class="parameter_description"><p>the index of the element to retrieve</p></td>
1042 <td class="parameter_annotations"> </td>
1047 <div class="refsect3">
1048 <a name="json-array-get-double-element.returns"></a><h4>Returns</h4>
1049 <p> the floating point value</p>
1051 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
1054 <div class="refsect2">
1055 <a name="json-array-add-int-element"></a><h3>json_array_add_int_element ()</h3>
1056 <pre class="programlisting"><span class="returnvalue">void</span>
1057 json_array_add_int_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
1058 <em class="parameter"><code><span class="type">gint64</span> value</code></em>);</pre>
1059 <p>Conveniently adds an integer <em class="parameter"><code>value</code></em>
1060 into <em class="parameter"><code>array</code></em>
1062 <p>See also: <a class="link" href="json-glib-JSON-Array.html#json-array-add-element" title="json_array_add_element ()"><code class="function">json_array_add_element()</code></a>, <a class="link" href="json-glib-JSON-Node.html#json-node-set-int" title="json_node_set_int ()"><code class="function">json_node_set_int()</code></a></p>
1063 <div class="refsect3">
1064 <a name="json-array-add-int-element.parameters"></a><h4>Parameters</h4>
1065 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1067 <col width="150px" class="parameters_name">
1068 <col class="parameters_description">
1069 <col width="200px" class="parameters_annotations">
1073 <td class="parameter_name"><p>array</p></td>
1074 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
1075 <td class="parameter_annotations"> </td>
1078 <td class="parameter_name"><p>value</p></td>
1079 <td class="parameter_description"><p>an integer value</p></td>
1080 <td class="parameter_annotations"> </td>
1085 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
1088 <div class="refsect2">
1089 <a name="json-array-get-int-element"></a><h3>json_array_get_int_element ()</h3>
1090 <pre class="programlisting"><span class="returnvalue">gint64</span>
1091 json_array_get_int_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
1092 <em class="parameter"><code><span class="type">guint</span> index_</code></em>);</pre>
1093 <p>Conveniently retrieves the integer value of the element at <em class="parameter"><code>index_</code></em>
1095 inside <em class="parameter"><code>array</code></em>
1097 <p>See also: <a class="link" href="json-glib-JSON-Array.html#json-array-get-element" title="json_array_get_element ()"><code class="function">json_array_get_element()</code></a>, <a class="link" href="json-glib-JSON-Node.html#json-node-get-int" title="json_node_get_int ()"><code class="function">json_node_get_int()</code></a></p>
1098 <div class="refsect3">
1099 <a name="json-array-get-int-element.parameters"></a><h4>Parameters</h4>
1100 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1102 <col width="150px" class="parameters_name">
1103 <col class="parameters_description">
1104 <col width="200px" class="parameters_annotations">
1108 <td class="parameter_name"><p>array</p></td>
1109 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
1110 <td class="parameter_annotations"> </td>
1113 <td class="parameter_name"><p>index_</p></td>
1114 <td class="parameter_description"><p>the index of the element to retrieve</p></td>
1115 <td class="parameter_annotations"> </td>
1120 <div class="refsect3">
1121 <a name="json-array-get-int-element.returns"></a><h4>Returns</h4>
1122 <p> the integer value</p>
1124 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
1127 <div class="refsect2">
1128 <a name="json-array-add-null-element"></a><h3>json_array_add_null_element ()</h3>
1129 <pre class="programlisting"><span class="returnvalue">void</span>
1130 json_array_add_null_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>);</pre>
1131 <p>Conveniently adds a null element into <em class="parameter"><code>array</code></em>
1133 <p>See also: <a class="link" href="json-glib-JSON-Array.html#json-array-add-element" title="json_array_add_element ()"><code class="function">json_array_add_element()</code></a>, <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-NULL:CAPS"><code class="literal">JSON_NODE_NULL</code></a></p>
1134 <div class="refsect3">
1135 <a name="json-array-add-null-element.parameters"></a><h4>Parameters</h4>
1136 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1138 <col width="150px" class="parameters_name">
1139 <col class="parameters_description">
1140 <col width="200px" class="parameters_annotations">
1143 <td class="parameter_name"><p>array</p></td>
1144 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
1145 <td class="parameter_annotations"> </td>
1149 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
1152 <div class="refsect2">
1153 <a name="json-array-get-null-element"></a><h3>json_array_get_null_element ()</h3>
1154 <pre class="programlisting"><span class="returnvalue">gboolean</span>
1155 json_array_get_null_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
1156 <em class="parameter"><code><span class="type">guint</span> index_</code></em>);</pre>
1157 <p>Conveniently retrieves whether the element at <em class="parameter"><code>index_</code></em>
1159 <p>See also: <a class="link" href="json-glib-JSON-Array.html#json-array-get-element" title="json_array_get_element ()"><code class="function">json_array_get_element()</code></a>, <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-TYPE:CAPS" title="JSON_NODE_TYPE()"><code class="function">JSON_NODE_TYPE()</code></a>, <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-NULL:CAPS"><code class="literal">JSON_NODE_NULL</code></a></p>
1160 <div class="refsect3">
1161 <a name="json-array-get-null-element.parameters"></a><h4>Parameters</h4>
1162 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1164 <col width="150px" class="parameters_name">
1165 <col class="parameters_description">
1166 <col width="200px" class="parameters_annotations">
1170 <td class="parameter_name"><p>array</p></td>
1171 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
1172 <td class="parameter_annotations"> </td>
1175 <td class="parameter_name"><p>index_</p></td>
1176 <td class="parameter_description"><p>the index of the element to retrieve</p></td>
1177 <td class="parameter_annotations"> </td>
1182 <div class="refsect3">
1183 <a name="json-array-get-null-element.returns"></a><h4>Returns</h4>
1184 <p> <code class="literal">TRUE</code> if the element is null</p>
1186 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
1189 <div class="refsect2">
1190 <a name="json-array-add-object-element"></a><h3>json_array_add_object_element ()</h3>
1191 <pre class="programlisting"><span class="returnvalue">void</span>
1192 json_array_add_object_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
1193 <em class="parameter"><code><a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a> *value</code></em>);</pre>
1194 <p>Conveniently adds an object into <em class="parameter"><code>array</code></em>
1195 . The <em class="parameter"><code>array</code></em>
1197 of the newly added <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a></p>
1198 <p>See also: <a class="link" href="json-glib-JSON-Array.html#json-array-add-element" title="json_array_add_element ()"><code class="function">json_array_add_element()</code></a>, <a class="link" href="json-glib-JSON-Node.html#json-node-take-object" title="json_node_take_object ()"><code class="function">json_node_take_object()</code></a></p>
1199 <div class="refsect3">
1200 <a name="json-array-add-object-element.parameters"></a><h4>Parameters</h4>
1201 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1203 <col width="150px" class="parameters_name">
1204 <col class="parameters_description">
1205 <col width="200px" class="parameters_annotations">
1209 <td class="parameter_name"><p>array</p></td>
1210 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
1211 <td class="parameter_annotations"> </td>
1214 <td class="parameter_name"><p>value</p></td>
1215 <td class="parameter_description"><p> a <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a>. </p></td>
1216 <td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
1221 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
1224 <div class="refsect2">
1225 <a name="json-array-get-object-element"></a><h3>json_array_get_object_element ()</h3>
1226 <pre class="programlisting"><a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="returnvalue">JsonObject</span></a> *
1227 json_array_get_object_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
1228 <em class="parameter"><code><span class="type">guint</span> index_</code></em>);</pre>
1229 <p>Conveniently retrieves the object from the element at <em class="parameter"><code>index_</code></em>
1231 inside <em class="parameter"><code>array</code></em>
1233 <p>See also: <a class="link" href="json-glib-JSON-Array.html#json-array-get-element" title="json_array_get_element ()"><code class="function">json_array_get_element()</code></a>, <a class="link" href="json-glib-JSON-Node.html#json-node-get-object" title="json_node_get_object ()"><code class="function">json_node_get_object()</code></a></p>
1234 <div class="refsect3">
1235 <a name="json-array-get-object-element.parameters"></a><h4>Parameters</h4>
1236 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1238 <col width="150px" class="parameters_name">
1239 <col class="parameters_description">
1240 <col width="200px" class="parameters_annotations">
1244 <td class="parameter_name"><p>array</p></td>
1245 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
1246 <td class="parameter_annotations"> </td>
1249 <td class="parameter_name"><p>index_</p></td>
1250 <td class="parameter_description"><p>the index of the element to retrieve</p></td>
1251 <td class="parameter_annotations"> </td>
1256 <div class="refsect3">
1257 <a name="json-array-get-object-element.returns"></a><h4>Returns</h4>
1258 <p> the object. </p>
1259 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
1261 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
1264 <div class="refsect2">
1265 <a name="json-array-add-string-element"></a><h3>json_array_add_string_element ()</h3>
1266 <pre class="programlisting"><span class="returnvalue">void</span>
1267 json_array_add_string_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
1268 <em class="parameter"><code>const <span class="type">gchar</span> *value</code></em>);</pre>
1269 <p>Conveniently adds a string <em class="parameter"><code>value</code></em>
1270 into <em class="parameter"><code>array</code></em>
1272 <p>See also: <a class="link" href="json-glib-JSON-Array.html#json-array-add-element" title="json_array_add_element ()"><code class="function">json_array_add_element()</code></a>, <a class="link" href="json-glib-JSON-Node.html#json-node-set-string" title="json_node_set_string ()"><code class="function">json_node_set_string()</code></a></p>
1273 <div class="refsect3">
1274 <a name="json-array-add-string-element.parameters"></a><h4>Parameters</h4>
1275 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1277 <col width="150px" class="parameters_name">
1278 <col class="parameters_description">
1279 <col width="200px" class="parameters_annotations">
1283 <td class="parameter_name"><p>array</p></td>
1284 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
1285 <td class="parameter_annotations"> </td>
1288 <td class="parameter_name"><p>value</p></td>
1289 <td class="parameter_description"><p>a string value</p></td>
1290 <td class="parameter_annotations"> </td>
1295 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
1298 <div class="refsect2">
1299 <a name="json-array-get-string-element"></a><h3>json_array_get_string_element ()</h3>
1300 <pre class="programlisting">const <span class="returnvalue">gchar</span> *
1301 json_array_get_string_element (<em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>,
1302 <em class="parameter"><code><span class="type">guint</span> index_</code></em>);</pre>
1303 <p>Conveniently retrieves the string value of the element at <em class="parameter"><code>index_</code></em>
1305 inside <em class="parameter"><code>array</code></em>
1307 <p>See also: <a class="link" href="json-glib-JSON-Array.html#json-array-get-element" title="json_array_get_element ()"><code class="function">json_array_get_element()</code></a>, <a class="link" href="json-glib-JSON-Node.html#json-node-get-string" title="json_node_get_string ()"><code class="function">json_node_get_string()</code></a></p>
1308 <div class="refsect3">
1309 <a name="json-array-get-string-element.parameters"></a><h4>Parameters</h4>
1310 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1312 <col width="150px" class="parameters_name">
1313 <col class="parameters_description">
1314 <col width="200px" class="parameters_annotations">
1318 <td class="parameter_name"><p>array</p></td>
1319 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
1320 <td class="parameter_annotations"> </td>
1323 <td class="parameter_name"><p>index_</p></td>
1324 <td class="parameter_description"><p>the index of the element to retrieve</p></td>
1325 <td class="parameter_annotations"> </td>
1330 <div class="refsect3">
1331 <a name="json-array-get-string-element.returns"></a><h4>Returns</h4>
1332 <p> the string value; the returned string is owned by
1333 the <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> and should not be modified or freed</p>
1335 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
1338 <div class="refsect1">
1339 <a name="json-glib-JSON-Array.other_details"></a><h2>Types and Values</h2>
1340 <div class="refsect2">
1341 <a name="JsonArray-struct"></a><h3>JsonArray</h3>
1342 <pre class="programlisting">typedef struct _JsonArray JsonArray;</pre>
1343 <p>A JSON array type. The contents of the <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> structure are private
1344 and should only be accessed by the provided API</p>
1348 <div class="footer">
1349 <hr>Generated by GTK-Doc V1.25.1</div>