212 | | As you know how to read and access the map fields from a maps, you can now learn how to write in such a datastructure. This is done by using the simple addToMap function once again defined in {{{zoo- kernel/service.h}}}. The {{{addToMap}}} function also takes three parameters : |
213 | | |
214 | | * {{{m}}} : a map pointer you want to update, |
215 | | * {{{n}}} : the name of the map you want to add or update the value, |
| 212 | As you know how to read and access the {{{map}}} fields from a maps, you can now learn how to write in such a datastructure. This is done by using the simple {{{setMapInMaps}}} function once again defined in {{{zoo- kernel/service.h}}}. The {{{setMapInMaps}}} function takes four parameters : |
| 213 | |
| 214 | * {{{m}}} : a {{{maps}}} pointer you want to update, |
| 215 | * {{{ns}}} : the name of the {{{maps}}} you want you want to update, |
| 216 | * {{{n}}} : the name of the {{{map}}} you want to add or update the value, |
218 | | Here is an example of how to add or edit the content {{{map}}} of a {{{maps}}} called {{{outputs}}} : |
219 | | |
220 | | {{{ |
221 | | #!c |
222 | | addToMap(outputs->content,"value","Hello from the C World !"); |
223 | | addToMap(outputs->content,"mimeType","text/plain"); |
224 | | addToMap(outputs->content,"encoding","UTF-8"); |
| 219 | Here is an example of how to add or edit the values of some {{{map}}} in the {{{Result}}} {{{maps}}} from {{{outputs}}} : |
| 220 | |
| 221 | {{{ |
| 222 | #!c |
| 223 | setMapInMaps(outputs,"Result","value","Hello from the C World !"); |
| 224 | setMapInMaps(outputs,"Result","mimeType","text/plain"); |
| 225 | setMapInMaps(outputs,"Result","encoding","UTF-8"); |