| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 5 | <title>Iterator</title> |
| 6 | <meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> |
| 7 | <link rel="home" href="index.html" title="Redland RDF Library Manual"> |
| 8 | <link rel="up" href="reference-manual.html" title="Part II. Reference Manual"> |
| 9 | <link rel="prev" href="redland-heuristics.html" title="Heuristics"> |
| 10 | <link rel="next" href="redland-list.html" title="List"> |
| 11 | <meta name="generator" content="GTK-Doc V1.18 (XML mode)"> |
| 12 | <link rel="stylesheet" href="style.css" type="text/css"> |
| 13 | </head> |
| 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="2"> |
| 16 | <tr valign="middle"> |
| 17 | <td><a accesskey="p" href="redland-heuristics.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td> |
| 18 | <td><a accesskey="u" href="reference-manual.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td> |
| 19 | <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td> |
| 20 | <th width="100%" align="center">Redland RDF Library Manual</th> |
| 21 | <td><a accesskey="n" href="redland-list.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td> |
| 22 | </tr> |
| 23 | <tr><td colspan="5" class="shortcuts"> |
| 24 | <a href="#redland-iterator.synopsis" class="shortcut">Top</a> |
| 25 | | |
| 26 | <a href="#redland-iterator.description" class="shortcut">Description</a> |
| 27 | </td></tr> |
| 28 | </table> |
| 29 | <div class="refentry"> |
| 30 | <a name="redland-iterator"></a><div class="titlepage"></div> |
| 31 | <div class="refnamediv"><table width="100%"><tr> |
| 32 | <td valign="top"> |
| 33 | <h2><span class="refentrytitle"><a name="redland-iterator.top_of_page"></a>Iterator</span></h2> |
| 34 | <p>Iterator — Iterate a sequence of objects across some other object.</p> |
| 35 | </td> |
| 36 | <td valign="top" align="right"></td> |
| 37 | </tr></table></div> |
| 38 | <div class="refsynopsisdiv"> |
| 39 | <a name="redland-iterator.synopsis"></a><h2>Synopsis</h2> |
| 40 | <pre class="synopsis">typedef <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator">librdf_iterator</a>; |
| 41 | enum <a class="link" href="redland-iterator.html#librdf-iterator-get-method-flags" title="enum librdf_iterator_get_method_flags">librdf_iterator_get_method_flags</a>; |
| 42 | <span class="returnvalue">void</span> * (<a class="link" href="redland-iterator.html#librdf-iterator-map-handler" title="librdf_iterator_map_handler ()">*librdf_iterator_map_handler</a>) (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>, |
| 43 | <em class="parameter"><code><span class="type">void</span> *map_context</code></em>, |
| 44 | <em class="parameter"><code><span class="type">void</span> *item</code></em>); |
| 45 | <span class="returnvalue">void</span> (<a class="link" href="redland-iterator.html#librdf-iterator-map-free-context-handler" title="librdf_iterator_map_free_context_handler ()">*librdf_iterator_map_free_context_handler</a>) |
| 46 | (<em class="parameter"><code><span class="type">void</span> *map_context</code></em>); |
| 47 | <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="returnvalue">librdf_iterator</span></a> * <a class="link" href="redland-iterator.html#librdf-new-iterator" title="librdf_new_iterator ()">librdf_new_iterator</a> (<em class="parameter"><code><a class="link" href="redland-world.html#librdf-world" title="librdf_world"><span class="type">librdf_world</span></a> *world</code></em>, |
| 48 | <em class="parameter"><code><span class="type">void</span> *context</code></em>, |
| 49 | <em class="parameter"><code><span class="type">int</span> (*is_end_method) (void*)</code></em>, |
| 50 | <em class="parameter"><code><span class="type">int</span> (*next_method) (void*)</code></em>, |
| 51 | <em class="parameter"><code><span class="type">void</span>* (*get_method) (void*, int)</code></em>, |
| 52 | <em class="parameter"><code><span class="type">void</span> (*finished_method) (void*)</code></em>); |
| 53 | <span class="returnvalue">void</span> <a class="link" href="redland-iterator.html#librdf-free-iterator" title="librdf_free_iterator ()">librdf_free_iterator</a> (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>); |
| 54 | <span class="returnvalue">int</span> <a class="link" href="redland-iterator.html#librdf-iterator-end" title="librdf_iterator_end ()">librdf_iterator_end</a> (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>); |
| 55 | <span class="returnvalue">int</span> <a class="link" href="redland-iterator.html#librdf-iterator-have-elements" title="librdf_iterator_have_elements ()">librdf_iterator_have_elements</a> (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>); |
| 56 | <span class="returnvalue">int</span> <a class="link" href="redland-iterator.html#librdf-iterator-next" title="librdf_iterator_next ()">librdf_iterator_next</a> (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>); |
| 57 | <span class="returnvalue">void</span> * <a class="link" href="redland-iterator.html#librdf-iterator-get-object" title="librdf_iterator_get_object ()">librdf_iterator_get_object</a> (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>); |
| 58 | <span class="returnvalue">void</span> * <a class="link" href="redland-iterator.html#librdf-iterator-get-context" title="librdf_iterator_get_context ()">librdf_iterator_get_context</a> (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>); |
| 59 | <span class="returnvalue">void</span> * <a class="link" href="redland-iterator.html#librdf-iterator-get-key" title="librdf_iterator_get_key ()">librdf_iterator_get_key</a> (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>); |
| 60 | <span class="returnvalue">void</span> * <a class="link" href="redland-iterator.html#librdf-iterator-get-value" title="librdf_iterator_get_value ()">librdf_iterator_get_value</a> (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>); |
| 61 | <span class="returnvalue">int</span> <a class="link" href="redland-iterator.html#librdf-iterator-add-map" title="librdf_iterator_add_map ()">librdf_iterator_add_map</a> (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>, |
| 62 | <em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator-map-handler" title="librdf_iterator_map_handler ()"><span class="type">librdf_iterator_map_handler</span></a> map_function</code></em>, |
| 63 | <em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator-map-free-context-handler" title="librdf_iterator_map_free_context_handler ()"><span class="type">librdf_iterator_map_free_context_handler</span></a> free_context</code></em>, |
| 64 | <em class="parameter"><code><span class="type">void</span> *map_context</code></em>); |
| 65 | <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="returnvalue">librdf_iterator</span></a> * <a class="link" href="redland-iterator.html#librdf-new-empty-iterator" title="librdf_new_empty_iterator ()">librdf_new_empty_iterator</a> (<em class="parameter"><code><a class="link" href="redland-world.html#librdf-world" title="librdf_world"><span class="type">librdf_world</span></a> *world</code></em>); |
| 66 | </pre> |
| 67 | </div> |
| 68 | <div class="refsect1"> |
| 69 | <a name="redland-iterator.description"></a><h2>Description</h2> |
| 70 | <p> |
| 71 | Provides a way to operate across a sequence of objects that are |
| 72 | generated one-by-one on demand. The returned objects can be of any |
| 73 | type but the main public methods are on the <a class="link" href="redland-model.html#librdf-model" title="librdf_model"><span class="type">librdf_model</span></a> classs and |
| 74 | return sequence of <a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> objects such as <a class="link" href="redland-model.html#librdf-model-get-sources" title="librdf_model_get_sources ()"><code class="function">librdf_model_get_sources()</code></a>. |
| 75 | </p> |
| 76 | </div> |
| 77 | <div class="refsect1"> |
| 78 | <a name="redland-iterator.details"></a><h2>Details</h2> |
| 79 | <div class="refsect2"> |
| 80 | <a name="librdf-iterator"></a><h3>librdf_iterator</h3> |
| 81 | <pre class="programlisting">typedef struct librdf_iterator_s librdf_iterator; |
| 82 | </pre> |
| 83 | <p> |
| 84 | Redland iterator class. |
| 85 | </p> |
| 86 | </div> |
| 87 | <hr> |
| 88 | <div class="refsect2"> |
| 89 | <a name="librdf-iterator-get-method-flags"></a><h3>enum librdf_iterator_get_method_flags</h3> |
| 90 | <pre class="programlisting">typedef enum { |
| 91 | LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT = 0, |
| 92 | LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT = 1, |
| 93 | LIBRDF_ITERATOR_GET_METHOD_GET_KEY = 2, |
| 94 | LIBRDF_ITERATOR_GET_METHOD_GET_VALUE = 3 |
| 95 | } librdf_iterator_get_method_flags; |
| 96 | </pre> |
| 97 | <p> |
| 98 | Flags for <a class="link" href="redland-iterator.html#librdf-new-iterator" title="librdf_new_iterator ()"><code class="function">librdf_new_iterator()</code></a> get_method function pointer. |
| 99 | </p> |
| 100 | <div class="variablelist"><table border="0"> |
| 101 | <col align="left" valign="top"> |
| 102 | <tbody> |
| 103 | <tr> |
| 104 | <td><p><a name="LIBRDF-ITERATOR-GET-METHOD-GET-OBJECT:CAPS"></a><span class="term"><code class="literal">LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT</code></span></p></td> |
| 105 | <td>get object from iterator - implementing <a class="link" href="redland-iterator.html#librdf-iterator-get-context" title="librdf_iterator_get_context ()"><code class="function">librdf_iterator_get_context()</code></a> |
| 106 | </td> |
| 107 | </tr> |
| 108 | <tr> |
| 109 | <td><p><a name="LIBRDF-ITERATOR-GET-METHOD-GET-CONTEXT:CAPS"></a><span class="term"><code class="literal">LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT</code></span></p></td> |
| 110 | <td>get context from iterator - implementing <a class="link" href="redland-iterator.html#librdf-iterator-get-object" title="librdf_iterator_get_object ()"><code class="function">librdf_iterator_get_object()</code></a> |
| 111 | </td> |
| 112 | </tr> |
| 113 | <tr> |
| 114 | <td><p><a name="LIBRDF-ITERATOR-GET-METHOD-GET-KEY:CAPS"></a><span class="term"><code class="literal">LIBRDF_ITERATOR_GET_METHOD_GET_KEY</code></span></p></td> |
| 115 | <td>get iterator key object from iterator - implementing <a class="link" href="redland-iterator.html#librdf-iterator-get-key" title="librdf_iterator_get_key ()"><code class="function">librdf_iterator_get_key()</code></a> |
| 116 | </td> |
| 117 | </tr> |
| 118 | <tr> |
| 119 | <td><p><a name="LIBRDF-ITERATOR-GET-METHOD-GET-VALUE:CAPS"></a><span class="term"><code class="literal">LIBRDF_ITERATOR_GET_METHOD_GET_VALUE</code></span></p></td> |
| 120 | <td>get iterator value from iterator - implementing <a class="link" href="redland-iterator.html#librdf-iterator-get-value" title="librdf_iterator_get_value ()"><code class="function">librdf_iterator_get_value()</code></a> |
| 121 | </td> |
| 122 | </tr> |
| 123 | </tbody> |
| 124 | </table></div> |
| 125 | </div> |
| 126 | <hr> |
| 127 | <div class="refsect2"> |
| 128 | <a name="librdf-iterator-map-handler"></a><h3>librdf_iterator_map_handler ()</h3> |
| 129 | <pre class="programlisting"><span class="returnvalue">void</span> * (*librdf_iterator_map_handler) (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>, |
| 130 | <em class="parameter"><code><span class="type">void</span> *map_context</code></em>, |
| 131 | <em class="parameter"><code><span class="type">void</span> *item</code></em>);</pre> |
| 132 | <p> |
| 133 | Map function for a <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> map operation. |
| 134 | </p> |
| 135 | <p> |
| 136 | See <a class="link" href="redland-iterator.html#librdf-iterator-add-map" title="librdf_iterator_add_map ()"><code class="function">librdf_iterator_add_map()</code></a>. |
| 137 | </p> |
| 138 | <div class="variablelist"><table border="0"> |
| 139 | <col align="left" valign="top"> |
| 140 | <tbody> |
| 141 | <tr> |
| 142 | <td><p><span class="term"><em class="parameter"><code>iterator</code></em> :</span></p></td> |
| 143 | <td>Iterator that this map is operating over.</td> |
| 144 | </tr> |
| 145 | <tr> |
| 146 | <td><p><span class="term"><em class="parameter"><code>map_context</code></em> :</span></p></td> |
| 147 | <td>Map data context pointer.</td> |
| 148 | </tr> |
| 149 | <tr> |
| 150 | <td><p><span class="term"><em class="parameter"><code>item</code></em> :</span></p></td> |
| 151 | <td>Pointer to the current item in the iteration.</td> |
| 152 | </tr> |
| 153 | <tr> |
| 154 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| 155 | <td>item in keep the iteration or NULL to remove it</td> |
| 156 | </tr> |
| 157 | </tbody> |
| 158 | </table></div> |
| 159 | </div> |
| 160 | <hr> |
| 161 | <div class="refsect2"> |
| 162 | <a name="librdf-iterator-map-free-context-handler"></a><h3>librdf_iterator_map_free_context_handler ()</h3> |
| 163 | <pre class="programlisting"><span class="returnvalue">void</span> (*librdf_iterator_map_free_context_handler) |
| 164 | (<em class="parameter"><code><span class="type">void</span> *map_context</code></em>);</pre> |
| 165 | <p> |
| 166 | Free handler function for a <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> map operation. |
| 167 | </p> |
| 168 | <p> |
| 169 | See <a class="link" href="redland-iterator.html#librdf-iterator-add-map" title="librdf_iterator_add_map ()"><code class="function">librdf_iterator_add_map()</code></a>. |
| 170 | </p> |
| 171 | <div class="variablelist"><table border="0"> |
| 172 | <col align="left" valign="top"> |
| 173 | <tbody><tr> |
| 174 | <td><p><span class="term"><em class="parameter"><code>map_context</code></em> :</span></p></td> |
| 175 | <td>Map data context pointer.</td> |
| 176 | </tr></tbody> |
| 177 | </table></div> |
| 178 | </div> |
| 179 | <hr> |
| 180 | <div class="refsect2"> |
| 181 | <a name="librdf-new-iterator"></a><h3>librdf_new_iterator ()</h3> |
| 182 | <pre class="programlisting"><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="returnvalue">librdf_iterator</span></a> * librdf_new_iterator (<em class="parameter"><code><a class="link" href="redland-world.html#librdf-world" title="librdf_world"><span class="type">librdf_world</span></a> *world</code></em>, |
| 183 | <em class="parameter"><code><span class="type">void</span> *context</code></em>, |
| 184 | <em class="parameter"><code><span class="type">int</span> (*is_end_method) (void*)</code></em>, |
| 185 | <em class="parameter"><code><span class="type">int</span> (*next_method) (void*)</code></em>, |
| 186 | <em class="parameter"><code><span class="type">void</span>* (*get_method) (void*, int)</code></em>, |
| 187 | <em class="parameter"><code><span class="type">void</span> (*finished_method) (void*)</code></em>);</pre> |
| 188 | <p> |
| 189 | Constructor - create a new <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> object. |
| 190 | The iterator object takes ownership of <em class="parameter"><code>context</code></em> and frees it with <em class="parameter"><code>finished_method</code></em>. |
| 191 | The finished method is not called if librdf_new_iterator fails and returns NULL. |
| 192 | </p> |
| 193 | <div class="variablelist"><table border="0"> |
| 194 | <col align="left" valign="top"> |
| 195 | <tbody> |
| 196 | <tr> |
| 197 | <td><p><span class="term"><em class="parameter"><code>world</code></em> :</span></p></td> |
| 198 | <td>redland world object</td> |
| 199 | </tr> |
| 200 | <tr> |
| 201 | <td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td> |
| 202 | <td>context to pass to the iterator functions</td> |
| 203 | </tr> |
| 204 | <tr> |
| 205 | <td><p><span class="term"><em class="parameter"><code>is_end_method</code></em> :</span></p></td> |
| 206 | <td>function to call to see if the iteration has ended</td> |
| 207 | </tr> |
| 208 | <tr> |
| 209 | <td><p><span class="term"><em class="parameter"><code>next_method</code></em> :</span></p></td> |
| 210 | <td>function to get the next element</td> |
| 211 | </tr> |
| 212 | <tr> |
| 213 | <td><p><span class="term"><em class="parameter"><code>get_method</code></em> :</span></p></td> |
| 214 | <td>function to get the next element</td> |
| 215 | </tr> |
| 216 | <tr> |
| 217 | <td><p><span class="term"><em class="parameter"><code>finished_method</code></em> :</span></p></td> |
| 218 | <td>function to destroy the iterator context (or NULL if not needed)</td> |
| 219 | </tr> |
| 220 | <tr> |
| 221 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| 222 | <td>a new <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> object or NULL on failure</td> |
| 223 | </tr> |
| 224 | </tbody> |
| 225 | </table></div> |
| 226 | </div> |
| 227 | <hr> |
| 228 | <div class="refsect2"> |
| 229 | <a name="librdf-free-iterator"></a><h3>librdf_free_iterator ()</h3> |
| 230 | <pre class="programlisting"><span class="returnvalue">void</span> librdf_free_iterator (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>);</pre> |
| 231 | <p> |
| 232 | Destructor - destroy a <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> object. |
| 233 | </p> |
| 234 | <div class="variablelist"><table border="0"> |
| 235 | <col align="left" valign="top"> |
| 236 | <tbody><tr> |
| 237 | <td><p><span class="term"><em class="parameter"><code>iterator</code></em> :</span></p></td> |
| 238 | <td>the <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> object</td> |
| 239 | </tr></tbody> |
| 240 | </table></div> |
| 241 | </div> |
| 242 | <hr> |
| 243 | <div class="refsect2"> |
| 244 | <a name="librdf-iterator-end"></a><h3>librdf_iterator_end ()</h3> |
| 245 | <pre class="programlisting"><span class="returnvalue">int</span> librdf_iterator_end (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>);</pre> |
| 246 | <p> |
| 247 | Test if the iterator has finished. |
| 248 | </p> |
| 249 | <div class="variablelist"><table border="0"> |
| 250 | <col align="left" valign="top"> |
| 251 | <tbody> |
| 252 | <tr> |
| 253 | <td><p><span class="term"><em class="parameter"><code>iterator</code></em> :</span></p></td> |
| 254 | <td>the <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> object</td> |
| 255 | </tr> |
| 256 | <tr> |
| 257 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| 258 | <td>non 0 if the iterator has finished</td> |
| 259 | </tr> |
| 260 | </tbody> |
| 261 | </table></div> |
| 262 | </div> |
| 263 | <hr> |
| 264 | <div class="refsect2"> |
| 265 | <a name="librdf-iterator-have-elements"></a><h3>librdf_iterator_have_elements ()</h3> |
| 266 | <pre class="programlisting"><span class="returnvalue">int</span> librdf_iterator_have_elements (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>);</pre> |
| 267 | <p> |
| 268 | Test if the iterator has finished. |
| 269 | </p> |
| 270 | <p> |
| 271 | DEPRECATED - use !librdf_iterator_end(iterator) |
| 272 | </p> |
| 273 | <div class="variablelist"><table border="0"> |
| 274 | <col align="left" valign="top"> |
| 275 | <tbody> |
| 276 | <tr> |
| 277 | <td><p><span class="term"><em class="parameter"><code>iterator</code></em> :</span></p></td> |
| 278 | <td>the <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> object</td> |
| 279 | </tr> |
| 280 | <tr> |
| 281 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| 282 | <td>0 if the iterator has finished</td> |
| 283 | </tr> |
| 284 | </tbody> |
| 285 | </table></div> |
| 286 | </div> |
| 287 | <hr> |
| 288 | <div class="refsect2"> |
| 289 | <a name="librdf-iterator-next"></a><h3>librdf_iterator_next ()</h3> |
| 290 | <pre class="programlisting"><span class="returnvalue">int</span> librdf_iterator_next (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>);</pre> |
| 291 | <p> |
| 292 | Move to the next iterator element. |
| 293 | </p> |
| 294 | <div class="variablelist"><table border="0"> |
| 295 | <col align="left" valign="top"> |
| 296 | <tbody> |
| 297 | <tr> |
| 298 | <td><p><span class="term"><em class="parameter"><code>iterator</code></em> :</span></p></td> |
| 299 | <td>the <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> object</td> |
| 300 | </tr> |
| 301 | <tr> |
| 302 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| 303 | <td>non 0 if the iterator has finished</td> |
| 304 | </tr> |
| 305 | </tbody> |
| 306 | </table></div> |
| 307 | </div> |
| 308 | <hr> |
| 309 | <div class="refsect2"> |
| 310 | <a name="librdf-iterator-get-object"></a><h3>librdf_iterator_get_object ()</h3> |
| 311 | <pre class="programlisting"><span class="returnvalue">void</span> * librdf_iterator_get_object (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>);</pre> |
| 312 | <p> |
| 313 | Get the current object from the iterator. |
| 314 | </p> |
| 315 | <p> |
| 316 | This method returns a SHARED pointer to the current iterator object |
| 317 | which should be copied by the caller to preserve it if the iterator |
| 318 | is moved on librdf_iterator_next or if it should last after the |
| 319 | iterator is closed. |
| 320 | </p> |
| 321 | <div class="variablelist"><table border="0"> |
| 322 | <col align="left" valign="top"> |
| 323 | <tbody> |
| 324 | <tr> |
| 325 | <td><p><span class="term"><em class="parameter"><code>iterator</code></em> :</span></p></td> |
| 326 | <td>the <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> object</td> |
| 327 | </tr> |
| 328 | <tr> |
| 329 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| 330 | <td>The next element or NULL if the iterator has finished.</td> |
| 331 | </tr> |
| 332 | </tbody> |
| 333 | </table></div> |
| 334 | </div> |
| 335 | <hr> |
| 336 | <div class="refsect2"> |
| 337 | <a name="librdf-iterator-get-context"></a><h3>librdf_iterator_get_context ()</h3> |
| 338 | <pre class="programlisting"><span class="returnvalue">void</span> * librdf_iterator_get_context (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>);</pre> |
| 339 | <p> |
| 340 | Get the context of the current object on the iterator. |
| 341 | </p> |
| 342 | <p> |
| 343 | This method returns a SHARED pointer to the current context node object |
| 344 | which should be copied by the caller to preserve it if the iterator |
| 345 | is moved on librdf_iterator_next or if it should last after the |
| 346 | iterator is closed. |
| 347 | </p> |
| 348 | <div class="variablelist"><table border="0"> |
| 349 | <col align="left" valign="top"> |
| 350 | <tbody> |
| 351 | <tr> |
| 352 | <td><p><span class="term"><em class="parameter"><code>iterator</code></em> :</span></p></td> |
| 353 | <td>the <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> object</td> |
| 354 | </tr> |
| 355 | <tr> |
| 356 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| 357 | <td>The context (can be NULL) or NULL if the iterator has finished.</td> |
| 358 | </tr> |
| 359 | </tbody> |
| 360 | </table></div> |
| 361 | </div> |
| 362 | <hr> |
| 363 | <div class="refsect2"> |
| 364 | <a name="librdf-iterator-get-key"></a><h3>librdf_iterator_get_key ()</h3> |
| 365 | <pre class="programlisting"><span class="returnvalue">void</span> * librdf_iterator_get_key (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>);</pre> |
| 366 | <p> |
| 367 | Get the key of the current object on the iterator. |
| 368 | </p> |
| 369 | <div class="variablelist"><table border="0"> |
| 370 | <col align="left" valign="top"> |
| 371 | <tbody> |
| 372 | <tr> |
| 373 | <td><p><span class="term"><em class="parameter"><code>iterator</code></em> :</span></p></td> |
| 374 | <td>the <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> object</td> |
| 375 | </tr> |
| 376 | <tr> |
| 377 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| 378 | <td>The context or NULL if the iterator has finished.</td> |
| 379 | </tr> |
| 380 | </tbody> |
| 381 | </table></div> |
| 382 | </div> |
| 383 | <hr> |
| 384 | <div class="refsect2"> |
| 385 | <a name="librdf-iterator-get-value"></a><h3>librdf_iterator_get_value ()</h3> |
| 386 | <pre class="programlisting"><span class="returnvalue">void</span> * librdf_iterator_get_value (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>);</pre> |
| 387 | <p> |
| 388 | Get the value of the current object on the iterator. |
| 389 | </p> |
| 390 | <div class="variablelist"><table border="0"> |
| 391 | <col align="left" valign="top"> |
| 392 | <tbody> |
| 393 | <tr> |
| 394 | <td><p><span class="term"><em class="parameter"><code>iterator</code></em> :</span></p></td> |
| 395 | <td>the <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> object</td> |
| 396 | </tr> |
| 397 | <tr> |
| 398 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| 399 | <td>The context or NULL if the iterator has finished.</td> |
| 400 | </tr> |
| 401 | </tbody> |
| 402 | </table></div> |
| 403 | </div> |
| 404 | <hr> |
| 405 | <div class="refsect2"> |
| 406 | <a name="librdf-iterator-add-map"></a><h3>librdf_iterator_add_map ()</h3> |
| 407 | <pre class="programlisting"><span class="returnvalue">int</span> librdf_iterator_add_map (<em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> *iterator</code></em>, |
| 408 | <em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator-map-handler" title="librdf_iterator_map_handler ()"><span class="type">librdf_iterator_map_handler</span></a> map_function</code></em>, |
| 409 | <em class="parameter"><code><a class="link" href="redland-iterator.html#librdf-iterator-map-free-context-handler" title="librdf_iterator_map_free_context_handler ()"><span class="type">librdf_iterator_map_free_context_handler</span></a> free_context</code></em>, |
| 410 | <em class="parameter"><code><span class="type">void</span> *map_context</code></em>);</pre> |
| 411 | <p> |
| 412 | Add a librdf_iterator mapping function. |
| 413 | </p> |
| 414 | <p> |
| 415 | Adds an iterator mapping function which operates over the iterator to |
| 416 | select which elements are returned; it will be applied as soon as |
| 417 | this method is called. |
| 418 | </p> |
| 419 | <p> |
| 420 | Several mapping functions can be added and they are applied in |
| 421 | the order given |
| 422 | </p> |
| 423 | <p> |
| 424 | The mapping function should return non 0 to allow the element to be |
| 425 | returned. |
| 426 | </p> |
| 427 | <div class="variablelist"><table border="0"> |
| 428 | <col align="left" valign="top"> |
| 429 | <tbody> |
| 430 | <tr> |
| 431 | <td><p><span class="term"><em class="parameter"><code>iterator</code></em> :</span></p></td> |
| 432 | <td>the iterator</td> |
| 433 | </tr> |
| 434 | <tr> |
| 435 | <td><p><span class="term"><em class="parameter"><code>map_function</code></em> :</span></p></td> |
| 436 | <td>the function to operate</td> |
| 437 | </tr> |
| 438 | <tr> |
| 439 | <td><p><span class="term"><em class="parameter"><code>free_context</code></em> :</span></p></td> |
| 440 | <td>the function to use to free the context (or NULL)</td> |
| 441 | </tr> |
| 442 | <tr> |
| 443 | <td><p><span class="term"><em class="parameter"><code>map_context</code></em> :</span></p></td> |
| 444 | <td>the context to pass to the map function</td> |
| 445 | </tr> |
| 446 | <tr> |
| 447 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| 448 | <td>Non 0 on failure</td> |
| 449 | </tr> |
| 450 | </tbody> |
| 451 | </table></div> |
| 452 | </div> |
| 453 | <hr> |
| 454 | <div class="refsect2"> |
| 455 | <a name="librdf-new-empty-iterator"></a><h3>librdf_new_empty_iterator ()</h3> |
| 456 | <pre class="programlisting"><a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="returnvalue">librdf_iterator</span></a> * librdf_new_empty_iterator (<em class="parameter"><code><a class="link" href="redland-world.html#librdf-world" title="librdf_world"><span class="type">librdf_world</span></a> *world</code></em>);</pre> |
| 457 | <p> |
| 458 | Constructor - create a new <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> with no content. |
| 459 | </p> |
| 460 | <div class="variablelist"><table border="0"> |
| 461 | <col align="left" valign="top"> |
| 462 | <tbody> |
| 463 | <tr> |
| 464 | <td><p><span class="term"><em class="parameter"><code>world</code></em> :</span></p></td> |
| 465 | <td>redland world object</td> |
| 466 | </tr> |
| 467 | <tr> |
| 468 | <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| 469 | <td>a new <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> object or NULL on failure</td> |
| 470 | </tr> |
| 471 | </tbody> |
| 472 | </table></div> |
| 473 | </div> |
| 474 | </div> |
| 475 | </div> |
| 476 | <div class="footer"> |
| 477 | <hr> |
| 478 | Generated by GTK-Doc V1.18</div> |
| 479 | </body> |
| 480 | </html> |