Zen API
 All Classes Files Functions Variables Typedefs Macros Groups Pages
kXml.h
Go to the documentation of this file.
1 /**
2  * @file kXml.h
3  * @brief Declares the kXml class.
4  *
5  * @internal
6  * Copyright (C) 2004-2014 by LMI Technologies Inc.
7  * Licensed under the MIT License.
8  * Redistributed files must retain the above copyright notice.
9  */
10 #ifndef K_API_XML_H
11 #define K_API_XML_H
12 
13 #include <kApi/kApiDef.h>
14 
15 kBeginHeader()
16 
17 /**
18  * @class kXml
19  * @extends kObject
20  * @ingroup kApi-Data
21  * @brief Represents an XML document.
22  */
23 //typedef kObject kXml; --forward-declared in kApiDef.x.h
24 
25 /**
26  * Represents an XML element within an XML document.
27  */
28 //typedef kPointer kXmlItem; --forward-declared in kApiDef.x.h
29 
30 /**
31  * Constructs a kXml object.
32  *
33  * The kXml object is initially empty; use kXml_AddItem with parent=kNULL to create a root node.
34  *
35  * @public @memberof kXml
36  * @param xml Destination for the constructed object handle.
37  * @param allocator Memory allocator.
38  * @return Operation status.
39  */
40 kFx(kStatus) kXml_Construct(kXml* xml, kAlloc allocator);
41 
42 /**
43  * Loads an XML document from a string object.
44  *
45  * @public @memberof kXml
46  * @param xml XML document.
47  * @param str String object.
48  * @return Operation status.
49  */
50 kFx(kStatus) kXml_FromString(kXml xml, kString str);
51 
52 /**
53  * Exports the XML document to a string object.
54  *
55  * @public @memberof kXml
56  * @param xml XML document.
57  * @param str String object to receive the XML content.
58  * @return Operation status.
59  */
60 kFx(kStatus) kXml_ToString(kXml xml, kString str);
61 
62 /**
63  * Saves an XML document to an in-memory file.
64  *
65  * @public @memberof kXml
66  * @param xml XML document.
67  * @param data Receives the file data.
68  * @param size Receives the file size.
69  * @param allocator Memory allocator (or kNULL for default).
70  * @return Operation status.
71  */
72 kFx(kStatus) kXml_SaveBytes(kXml xml, kByte** data, kSize* size, kAlloc allocator);
73 
74 /**
75  * Loads an XML document from an in-memory file.
76  *
77  * @public @memberof kXml
78  * @param xml Destination for the constructed object handle.
79  * @param data File data.
80  * @param size File size.
81  * @param allocator Memory allocator (or kNULL for default).
82  * @return Operation status.
83  */
84 kFx(kStatus) kXml_LoadBytes(kXml* xml, const kByte* data, kSize size, kAlloc allocator);
85 
86 /**
87  * Loads an XML document from file.
88  *
89  * @public @memberof kXml
90  * @param xml Destination for the constructed object handle.
91  * @param fileName Name of the file.
92  * @param allocator Memory allocator (or kNULL for default).
93  * @return Operation status.
94  */
95 kFx(kStatus) kXml_Load(kXml* xml, const kChar* fileName, kAlloc allocator);
96 
97 /**
98  * Loads an XML document from a stream.
99  *
100  * @public @memberof kXml
101  * @param xml XML object.
102  * @param stream Stream for reading.
103  * @return Operation status.
104  */
105 kFx(kStatus) kXml_Read(kXml xml, kStream stream);
106 
107 /**
108  * Writes an XML document to a stream.
109  *
110  * @public @memberof kXml
111  * @param xml XML object.
112  * @param stream Stream for writing.
113  * @return Operation status.
114  */
115 kFx(kStatus) kXml_Write(kXml xml, kStream stream);
116 
117 /**
118  * Loads an XML document from a character array.
119  *
120  * @public @memberof kXml
121  * @param xml Destination for the constructed object handle.
122  * @param str Null-terminated character array to parse.
123  * @param allocator Memory allocator (or kNULL for default).
124  * @return Operation status.
125  */
126 kFx(kStatus) kXml_FromText(kXml* xml, const kChar* str, kAlloc allocator);
127 
128 /**
129  * Compacts the XML object for minimum memory usage.
130  *
131  * Compacting a document renders existing kXmlItem handles invalid.
132  *
133  * @public @memberof kXml
134  * @param xml XML document object.
135  * @return Operation status.
136  */
137 kFx(kStatus) kXml_Compact(kXml xml);
138 
139 /**
140  * Saves the XML document object to file.
141  *
142  * @public @memberof kXml
143  * @param xml XML document.
144  * @param fileName Name of the file.
145  * @return Operation status.
146  */
147 kFx(kStatus) kXml_Save(kXml xml, const kChar* fileName);
148 
149 /**
150  * Removes all elements from the XML document.
151  *
152  * @public @memberof kXml
153  * @param xml XML document.
154  * @return Operation status.
155  */
156 kFx(kStatus) kXml_Clear(kXml xml);
157 
158 /**
159  * Copies the source document.
160  *
161  * @public @memberof kXml
162  * @param xml XML document.
163  * @param source Source document to be copied.
164  * @return Operation status.
165  */
166 kFx(kStatus) kXml_Assign(kXml xml, kXml source);
167 
168 /**
169  * Returns the root element of the XML document.
170  *
171  * @public @memberof kXml
172  * @param xml XML document.
173  * @return XML root node.
174  */
175 kFx(kXmlItem) kXml_Root(kXml xml);
176 
177 /**
178  * Returns the child node at the given relative path.
179  *
180  * @public @memberof kXml
181  * @param xml XML document.
182  * @param parent Parent node.
183  * @param path Path relative to the parent node.
184  * @return Operation status.
185  */
186 kFx(kXmlItem) kXml_Child(kXml xml, kXmlItem parent, const kChar* path);
187 
188 /**
189  * Returns the parent node of the given element.
190  *
191  * @public @memberof kXml
192  * @param xml XML document.
193  * @param item Element node.
194  * @return Operation status.
195  */
196 kFx(kXmlItem) kXml_Parent(kXml xml, kXmlItem item);
197 
198 /**
199  * Returns the first child element of the given parent node.
200  *
201  * @public @memberof kXml
202  * @param xml XML document.
203  * @param parent Parent node.
204  * @return Operation status.
205  */
206 kFx(kXmlItem) kXml_FirstChild(kXml xml, kXmlItem parent);
207 
208 /**
209  * Returns the last child element of the given parent node.
210  *
211  * @public @memberof kXml
212  * @param xml XML document.
213  * @param parent Parent node.
214  * @return Operation status.
215  */
216 kFx(kXmlItem) kXml_LastChild(kXml xml, kXmlItem parent);
217 
218 /**
219  * Returns the next sibling element of the given element node.
220  *
221  * @public @memberof kXml
222  * @param xml XML document.
223  * @param item Element node.
224  * @return Operation status.
225  */
226 kFx(kXmlItem) kXml_NextSibling(kXml xml, kXmlItem item);
227 
228 /**
229  * Returns the previous sibling element of the given element node.
230  *
231  * @public @memberof kXml
232  * @param xml XML document.
233  * @param item Element node.
234  * @return Operation status.
235  */
236 kFx(kXmlItem) kXml_PreviousSibling(kXml xml, kXmlItem item);
237 
238 /**
239  * Finds the root node, if it exists.
240  *
241  * @public @memberof kXml
242  * @param xml XML document.
243  * @param root Receives root node, if it exists.
244  * @return kOperation status (kERROR_FORMAT if not found).
245  */
246 kFx(kStatus) kXml_FindRoot(kXml xml, kXmlItem* root);
247 
248 /**
249  * Finds the child node at the given relative path, if it exists.
250  *
251  * @public @memberof kXml
252  * @param xml XML document.
253  * @param parent Parent node.
254  * @param path Path relative to the parent node.
255  * @param child Receives child node, if it exists.
256  * @return kOperation status (kERROR_FORMAT if not found).
257  */
258 kFx(kStatus) kXml_FindChild(kXml xml, kXmlItem parent, const kChar* path, kXmlItem* child);
259 
260 /**
261  * Reports whether a child node exists at the specified relative path.
262  *
263  * @public @memberof kXml
264  * @param xml XML document.
265  * @param parent Parent node.
266  * @param path Path relative to the parent node.
267  * @return kTRUE if child exists. kFALSE otherwise.
268  */
269 kFx(kBool) kXml_ChildExists(kXml xml, kXmlItem parent, const kChar* path);
270 
271 /**
272  * Returns the number of child nodes for the given parent node.
273  *
274  * @public @memberof kXml
275  * @param xml XML document.
276  * @param parent Parent node.
277  * @return Operation status.
278  */
279 kFx(kSize) kXml_ChildCount(kXml xml, kXmlItem parent);
280 
281 /**
282  * Returns a child node at a specific index within the list of child nodes
283  * for the given parent node.
284  *
285  * @public @memberof kXml
286  * @param xml XML document.
287  * @param parent Parent node.
288  * @param index Child node index.
289  * @return Operation status.
290  */
291 kFx(kXmlItem) kXml_ChildAt(kXml xml, kXmlItem parent, kSize index);
292 
293 /**
294  * Creates a child node at the specified path. Also creates necessary nodes for the path to
295  * be complete. If a child already exists for the specified path, its handle is returned
296  * and a new one is not created.
297  *
298  * @public @memberof kXml
299  * @param xml XML document.
300  * @param parent Parent node.
301  * @param path Path relative to the parent node.
302  * @param item Destination for the item handle.
303  * @return Operation status.
304  */
305 kFx(kStatus) kXml_EnsureChildExists(kXml xml, kXmlItem parent, const kChar* path, kXmlItem* item);
306 
307 /**
308  * Deletes all children in the specified parent item
309  *
310  * @public @memberof kXml
311  * @param xml XML document.
312  * @param item Parent node.
313  * @return Operation status.
314  */
315 kFx(kStatus) kXml_DeleteChildren(kXml xml, kXmlItem item);
316 
317 /**
318  * Inserts a new child node at the end of the specified parent node's child list.
319  *
320  * @public @memberof kXml
321  * @param xml XML document.
322  * @param parent Parent node.
323  * @param name Name of the new node.
324  * @param item Destination for the item handle.
325  * @return Operation status.
326  */
327 kFx(kStatus) kXml_AddItem(kXml xml, kXmlItem parent, const kChar* name, kXmlItem* item);
328 
329 /**
330  * Inserts a new node before the specified sibling node.
331  *
332  * @public @memberof kXml
333  * @param xml XML document.
334  * @param before Sibling node.
335  * @param name Name of the new node.
336  * @param item Destination for the item handle.
337  * @return Operation status.
338  */
339 kFx(kStatus) kXml_InsertItem(kXml xml, kXmlItem before, const kChar* name, kXmlItem* item);
340 
341 /**
342  * Copies a node from one XML document to another XML document, inserting a new node a specified location.
343  *
344  * @public @memberof kXml
345  * @param xml Destination XML document.
346  * @param parent Destination parent element.
347  * @param before Destination sibling element (kNULL appends to end of parent's child list).
348  * @param srcXml Source XML document.
349  * @param srcItem Source XML element.
350  * @param item Destination for the copied item handle.
351  * @return Operation status.
352  */
353 kFx(kStatus) kXml_CopyItem(kXml xml, kXmlItem parent, kXmlItem before, kXml srcXml, kXmlItem srcItem, kXmlItem* item);
354 
355 /**
356  * Copies a node from one XML document to another XML document, overwriting an existing element.
357  *
358  * @public @memberof kXml
359  * @param xml XML destination document.
360  * @param destItem XML destination element.
361  * @param srcXml Source XML document.
362  * @param srcItem Source XML element.
363  * @return Operation status.
364  */
365 kFx(kStatus) kXml_OverwriteItem(kXml xml, kXmlItem destItem, kXml srcXml, kXmlItem srcItem);
366 
367 /**
368  * Removes all children, attributes, and value from the XML element node.
369  *
370  * @public @memberof kXml
371  * @param xml XML document.
372  * @param item Element node.
373  * @return Operation status.
374  */
375 kFx(kStatus) kXml_ClearItem(kXml xml, kXmlItem item);
376 
377 /**
378  * Returns the name of an XML element node.
379  *
380  * @public @memberof kXml
381  * @param xml XML document.
382  * @param item Element node.
383  * @return Operation status.
384  */
385 kFx(const kChar*) kXml_ItemName(kXml xml, kXmlItem item);
386 
387 /**
388  * Sets the name of an XML element node.
389  *
390  * @public @memberof kXml
391  * @param xml XML document.
392  * @param item Element node.
393  * @param name Element name.
394  * @return Operation status.
395  */
396 kFx(kStatus) kXml_SetItemName(kXml xml, kXmlItem item, const kChar* name);
397 
398 /**
399  * Deletes an XML element node.
400  *
401  * @public @memberof kXml
402  * @param xml XML document object.
403  * @param item Element node.
404  * @return Operation status.
405  */
406 kFx(kStatus) kXml_DeleteItem(kXml xml, kXmlItem item);
407 
408 /**
409  * Gets XML element content as a character array.
410  *
411  * Use the kMemFree function to deallocate the received character array.
412  *
413  * @public @memberof kXml
414  * @param xml XML document.
415  * @param item Element node.
416  * @param str Receives null-terminated character array.
417  * @return Operation status.
418  */
419 kFx(kStatus) kXml_ItemStringZen(kXml xml, kXmlItem item, kChar** str);
420 
421 /**
422  * Gets XML element node content as a string object.
423  *
424  * @public @memberof kXml
425  * @param xml XML document.
426  * @param item Element node.
427  * @param str String object.
428  * @return Operation status.
429  */
430 kFx(kStatus) kXml_ItemString(kXml xml, kXmlItem item, kString str);
431 
432 /**
433  * Gets XML element content as a character array.
434  *
435  * @public @memberof kXml
436  * @param xml XML document.
437  * @param item Element node.
438  * @param str Character array.
439  * @param capacity Character array capacity, in bytes (includes null-terminator).
440  * @return Operation status.
441  */
442 kFx(kStatus) kXml_ItemText(kXml xml, kXmlItem item, kChar* str, kSize capacity);
443 
444 /**
445  * Gets XML element node content as a k16u value.
446  *
447  * @public @memberof kXml
448  * @param xml XML document.
449  * @param item Element node.
450  * @param value Returns XML content as a numeric value.
451  * @return Operation status.
452  */
453 kFx(kStatus) kXml_Item16u(kXml xml, kXmlItem item, k16u* value);
454 
455 /**
456  * Gets XML element node content as a k16s value.
457  *
458  * @public @memberof kXml
459  * @param xml XML document.
460  * @param item Element node.
461  * @param value Returns XML content as a numeric value.
462  * @return Operation status.
463  */
464 kFx(kStatus) kXml_Item16s(kXml xml, kXmlItem item, k16s* value);
465 
466 /**
467  * Gets XML element node content as a k32u value.
468  *
469  * @public @memberof kXml
470  * @param xml XML document.
471  * @param item Element node.
472  * @param value Returns XML content as a numeric value.
473  * @return Operation status.
474  */
475 kFx(kStatus) kXml_Item32u(kXml xml, kXmlItem item, k32u* value);
476 
477 /**
478  * Gets XML element node content as a k32s value.
479  *
480  * @public @memberof kXml
481  * @param xml XML document.
482  * @param item Element node.
483  * @param value Returns XML content as a numeric value.
484  * @return Operation status.
485  */
486 kFx(kStatus) kXml_Item32s(kXml xml, kXmlItem item, k32s* value);
487 
488 /**
489  * Gets XML element node content as a kBool value.
490  *
491  * @public @memberof kXml
492  * @param xml XML document.
493  * @param item Element node.
494  * @param value Returns XML content as a boolean value.
495  * @return Operation status.
496  */
497 kFx(kStatus) kXml_ItemBool(kXml xml, kXmlItem item, kBool* value);
498 
499 /**
500  * Gets XML element node content as a k64u value.
501  *
502  * @public @memberof kXml
503  * @param xml XML document.
504  * @param item Element node.
505  * @param value Returns XML content as a numeric value.
506  * @return Operation status.
507  */
508 kFx(kStatus) kXml_Item64u(kXml xml, kXmlItem item, k64u* value);
509 
510 /**
511  * Gets XML element node content as a k64s value.
512  *
513  * @public @memberof kXml
514  * @param xml XML document object.
515  * @param item Element node.
516  * @param value Returns XML content as a numeric value.
517  * @return Operation status.
518  */
519 kFx(kStatus) kXml_Item64s(kXml xml, kXmlItem item, k64s* value);
520 
521 /**
522  * Gets XML element node content as a kSize value.
523  *
524  * @public @memberof kXml
525  * @param xml XML document.
526  * @param item Element node.
527  * @param value Returns XML content as a numeric value.
528  * @return Operation status.
529  */
530 kFx(kStatus) kXml_ItemSize(kXml xml, kXmlItem item, kSize* value);
531 
532 /**
533  * Gets XML element node content as a k32s value.
534  *
535  * @public @memberof kXml
536  * @param xml XML document.
537  * @param item Element node.
538  * @param value Returns XML content as a numeric value.
539  * @return Operation status.
540  */
541 kFx(kStatus) kXml_Item32s(kXml xml, kXmlItem item, k32s* value);
542 
543 /**
544  * Gets XML element node content as a k32f value.
545  *
546  * @public @memberof kXml
547  * @param xml XML document object.
548  * @param item Element node.
549  * @param value Returns XML content as a numeric value.
550  * @return Operation status.
551  */
552 kFx(kStatus) kXml_Item32f(kXml xml, kXmlItem item, k32f* value);
553 
554 /**
555  * Gets XML element node content as a k64f value.
556  *
557  * @public @memberof kXml
558  * @param xml XML document.
559  * @param item Element node.
560  * @param value Returns XML content as a numeric value.
561  * @return Operation status.
562  */
563 kFx(kStatus) kXml_Item64f(kXml xml, kXmlItem item, k64f* value);
564 
565 /**
566  * Sets XML element node content from a character array.
567  *
568  * @public @memberof kXml
569  * @param xml XML document.
570  * @param item Element node.
571  * @param str Character array.
572  * @return Operation status.
573  */
574 kFx(kStatus) kXml_SetItemText(kXml xml, kXmlItem item, const kChar* str);
575 
576 /**
577  * Sets XML element node content from a k16u value.
578  *
579  * @public @memberof kXml
580  * @param xml XML document.
581  * @param item Element node.
582  * @param value Numeric value.
583  * @return Operation status.
584  */
585 kFx(kStatus) kXml_SetItem16u(kXml xml, kXmlItem item, k16u value);
586 
587 /**
588  * Sets XML element node content from a k16s value.
589  *
590  * @public @memberof kXml
591  * @param xml XML document.
592  * @param item Element node.
593  * @param value Numeric value.
594  * @return Operation status.
595  */
596 kFx(kStatus) kXml_SetItem16s(kXml xml, kXmlItem item, k16s value);
597 
598 /**
599  * Sets XML element node content from a k32u value.
600  *
601  * @public @memberof kXml
602  * @param xml XML document.
603  * @param item Element node.
604  * @param value Numeric value.
605  * @return Operation status.
606  */
607 kFx(kStatus) kXml_SetItem32u(kXml xml, kXmlItem item, k32u value);
608 
609 /**
610  * Sets XML element node content from a k32s value.
611  *
612  * @public @memberof kXml
613  * @param xml XML document.
614  * @param item Element node.
615  * @param value Numeric value.
616  * @return Operation status.
617  */
618 kFx(kStatus) kXml_SetItem32s(kXml xml, kXmlItem item, k32s value);
619 
620 /**
621  * Sets XML element node content from a kBool value.
622  *
623  * @public @memberof kXml
624  * @param xml XML document.
625  * @param item Element node.
626  * @param value Boolean value.
627  * @return Operation status.
628  */
629 kFx(kStatus) kXml_SetItemBool(kXml xml, kXmlItem item, kBool value);
630 
631 /**
632  * Sets XML element node content from a k64u value.
633  *
634  * @public @memberof kXml
635  * @param xml XML document.
636  * @param item Element node.
637  * @param value Numeric value.
638  * @return Operation status.
639  */
640 kFx(kStatus) kXml_SetItem64u(kXml xml, kXmlItem item, k64u value);
641 
642 /**
643  * Sets XML element node content from a k64s value.
644  *
645  * @public @memberof kXml
646  * @param xml XML document.
647  * @param item Element node.
648  * @param value Numeric value.
649  * @return Operation status.
650  */
651 kFx(kStatus) kXml_SetItem64s(kXml xml, kXmlItem item, k64s value);
652 
653 /**
654  * Sets XML element node content from a kSize value.
655  *
656  * @public @memberof kXml
657  * @param xml XML document.
658  * @param item Element node.
659  * @param value Numeric value.
660  * @return Operation status.
661  */
662 kFx(kStatus) kXml_SetItemSize(kXml xml, kXmlItem item, kSize value);
663 
664 /**
665  * Sets XML element node content from a k32f value.
666  *
667  * @public @memberof kXml
668  * @param xml XML document.
669  * @param item Element node.
670  * @param value Numeric value.
671  * @return Operation status.
672  */
673 kFx(kStatus) kXml_SetItem32f(kXml xml, kXmlItem item, k32f value);
674 
675 /**
676  * Sets XML element node content from a k64f value.
677  *
678  * @public @memberof kXml
679  * @param xml XML document object.
680  * @param item Element node.
681  * @param value Numeric value.
682  * @return Operation status.
683  */
684 kFx(kStatus) kXml_SetItem64f(kXml xml, kXmlItem item, k64f value);
685 
686 /**
687  * Gets XML element node content as a character array.
688  *
689  * @public @memberof kXml
690  * @param xml XML document.
691  * @param parent Parent node.
692  * @param path Path relative to the parent node.
693  * @param str Receives null-terminated character array.
694  * @return Operation status.
695  */
696 kFx(kStatus) kXml_ChildStringZen(kXml xml, kXmlItem parent, const kChar* path, kChar** str);
697 
698 /**
699  * Gets XML child node content as a string object.
700  *
701  * @public @memberof kXml
702  * @param xml XML document.
703  * @param parent Parent node.
704  * @param path Path relative to the parent node.
705  * @param str String object.
706  * @return Operation status.
707  */
708 kFx(kStatus) kXml_ChildString(kXml xml, kXmlItem parent, const kChar* path, kString str);
709 
710 /**
711  * Gets XML child node content as a character array.
712  *
713  * @public @memberof kXml
714  * @param xml XML document.
715  * @param parent Parent node.
716  * @param path Path relative to the parent node.
717  * @param str Character array.
718  * @param capacity Character array capacity, in bytes (includes null-terminator).
719  * @return Operation status.
720  */
721 kFx(kStatus) kXml_ChildText(kXml xml, kXmlItem parent, const kChar* path, kChar* str, kSize capacity);
722 
723 /**
724  * Gets XML child node content as a k16u value.
725  *
726  * @public @memberof kXml
727  * @param xml XML document.
728  * @param parent Parent node.
729  * @param path Path relative to the parent node.
730  * @param value Returns XML content as a numeric value.
731  * @return Operation status.
732  */
733 kFx(kStatus) kXml_Child16u(kXml xml, kXmlItem parent, const kChar* path, k16u* value);
734 
735 /**
736  * Gets XML child node content as a k16s value.
737  *
738  * @public @memberof kXml
739  * @param xml XML document.
740  * @param parent Parent node.
741  * @param path Path relative to the parent node.
742  * @param value Returns XML content as a numeric value.
743  * @return Operation status.
744  */
745 kFx(kStatus) kXml_Child16s(kXml xml, kXmlItem parent, const kChar* path, k16s* value);
746 
747 /**
748  * Gets XML child node content as a k32u value.
749  *
750  * @public @memberof kXml
751  * @param xml XML document.
752  * @param parent Parent node.
753  * @param path Path relative to the parent node.
754  * @param value Returns XML content as a numeric value.
755  * @return Operation status.
756  */
757 kFx(kStatus) kXml_Child32u(kXml xml, kXmlItem parent, const kChar* path, k32u* value);
758 
759 /**
760  * Gets XML child node content as a k32s value.
761  *
762  * @public @memberof kXml
763  * @param xml XML document.
764  * @param parent Parent node.
765  * @param path Path relative to the parent node.
766  * @param value Returns XML content as a numeric value.
767  * @return Operation status.
768  */
769 kFx(kStatus) kXml_Child32s(kXml xml, kXmlItem parent, const kChar* path, k32s* value);
770 
771 /**
772  * Gets XML child node content as a kBool value.
773  *
774  * @public @memberof kXml
775  * @param xml XML document.
776  * @param parent Parent node.
777  * @param path Path relative to the parent node.
778  * @param value Returns XML content as a boolean value.
779  * @return Operation status.
780  */
781 kFx(kStatus) kXml_ChildBool(kXml xml, kXmlItem parent, const kChar* path, kBool* value);
782 
783 /**
784  * Gets XML child node content as a k64u value.
785  *
786  * @public @memberof kXml
787  * @param xml XML document.
788  * @param parent Parent node.
789  * @param path Path relative to the parent node.
790  * @param value Returns XML content as a numeric value.
791  * @return Operation status.
792  */
793 kFx(kStatus) kXml_Child64u(kXml xml, kXmlItem parent, const kChar* path, k64u* value);
794 
795 /**
796  * Gets XML child node content as a k64s value.
797  *
798  * @public @memberof kXml
799  * @param xml XML document.
800  * @param parent Parent node.
801  * @param path Path relative to the parent node.
802  * @param value Returns XML content as a numeric value.
803  * @return Operation status.
804  */
805 kFx(kStatus) kXml_Child64s(kXml xml, kXmlItem parent, const kChar* path, k64s* value);
806 
807 /**
808  * Gets XML child node content as a kSize value.
809  *
810  * @public @memberof kXml
811  * @param xml XML document.
812  * @param parent Parent node.
813  * @param path Path relative to the parent node.
814  * @param value Returns XML content as a numeric value.
815  * @return Operation status.
816  */
817 kFx(kStatus) kXml_ChildSize(kXml xml, kXmlItem parent, const kChar* path, kSize* value);
818 
819 /**
820  * Gets XML child node content as a k32f value.
821  *
822  * @public @memberof kXml
823  * @param xml XML document.
824  * @param parent XML document.
825  * @param path Path relative to the parent node.
826  * @param value Returns XML content as a numeric value.
827  * @return Operation status.
828  */
829 kFx(kStatus) kXml_Child32f(kXml xml, kXmlItem parent, const kChar* path, k32f* value);
830 
831 /**
832  * Gets XML child node content as a k64f value.
833  *
834  * @public @memberof kXml
835  * @param xml XML document.
836  * @param parent XML document.
837  * @param path Path relative to the parent node.
838  * @param value Returns XML content as a numeric value.
839  * @return Operation status.
840  */
841 kFx(kStatus) kXml_Child64f(kXml xml, kXmlItem parent, const kChar* path, k64f* value);
842 /**
843  * Sets XML child node content from a character array.
844  *
845  * @public @memberof kXml
846  * @param xml XML document.
847  * @param parent Parent node.
848  * @param path Path relative to the parent node.
849  * @param str Character array.
850  * @return Operation status.
851  */
852 kFx(kStatus) kXml_SetChildText(kXml xml, kXmlItem parent, const kChar* path, const kChar* str);
853 
854 /**
855  * Sets XML child node content from a k16u value.
856  *
857  * @public @memberof kXml
858  * @param xml XML document object.
859  * @param parent Parent node.
860  * @param path Path relative to the parent node.
861  * @param value Numeric value.
862  * @return Operation status.
863  */
864 kFx(kStatus) kXml_SetChild16u(kXml xml, kXmlItem parent, const kChar* path, k16u value);
865 
866 /**
867  * Sets XML child node content from a k16s value.
868  *
869  * @public @memberof kXml
870  * @param xml XML document.
871  * @param parent Parent node.
872  * @param path Path relative to the parent node.
873  * @param value Numeric value.
874  * @return Operation status.
875  */
876 kFx(kStatus) kXml_SetChild16s(kXml xml, kXmlItem parent, const kChar* path, k16s value);
877 
878 /**
879  * Sets XML child node content from a k32u value.
880  *
881  * @public @memberof kXml
882  * @param xml XML document object.
883  * @param parent Parent node.
884  * @param path Path relative to the parent node.
885  * @param value Numeric value.
886  * @return Operation status.
887  */
888 kFx(kStatus) kXml_SetChild32u(kXml xml, kXmlItem parent, const kChar* path, k32u value);
889 
890 /**
891  * Sets XML child node content from a k32s value.
892  *
893  * @public @memberof kXml
894  * @param xml XML document.
895  * @param parent Parent node.
896  * @param path Path relative to the parent node.
897  * @param value Numeric value.
898  * @return Operation status.
899  */
900 kFx(kStatus) kXml_SetChild32s(kXml xml, kXmlItem parent, const kChar* path, k32s value);
901 
902 /**
903  * Sets XML child node content from a kBool value.
904  *
905  * @public @memberof kXml
906  * @param xml XML document.
907  * @param parent Parent node.
908  * @param path Path relative to the parent node.
909  * @param value Boolean value.
910  * @return Operation status.
911  */
912 kFx(kStatus) kXml_SetChildBool(kXml xml, kXmlItem parent, const kChar* path, kBool value);
913 
914 /**
915  * Sets XML child node content from a k64u value.
916  *
917  * @public @memberof kXml
918  * @param xml XML document.
919  * @param parent Parent node.
920  * @param path Path relative to the parent node.
921  * @param value Numeric value.
922  * @return Operation status.
923  */
924 kFx(kStatus) kXml_SetChild64u(kXml xml, kXmlItem parent, const kChar* path, k64u value);
925 
926 /**
927  * Sets XML child node content from a k64s value.
928  *
929  * @public @memberof kXml
930  * @param xml XML document.
931  * @param parent Parent node.
932  * @param path Path relative to the parent node.
933  * @param value Numeric value.
934  * @return Operation status.
935  */
936 kFx(kStatus) kXml_SetChild64s(kXml xml, kXmlItem parent, const kChar* path, k64s value);
937 
938 /**
939  * Sets XML child node content from a kSize value.
940  *
941  * @public @memberof kXml
942  * @param xml XML document.
943  * @param parent Parent node.
944  * @param path Path relative to the parent node.
945  * @param value Numeric value.
946  * @return Operation status.
947  */
948 kFx(kStatus) kXml_SetChildSize(kXml xml, kXmlItem parent, const kChar* path, kSize value);
949 
950 /**
951  * Sets XML child node content from a k32f value.
952  *
953  * @public @memberof kXml
954  * @param xml XML document.
955  * @param parent Parent node.
956  * @param path Path relative to the parent node.
957  * @param value Numeric value.
958  * @return Operation status.
959  */
960 kFx(kStatus) kXml_SetChild32f(kXml xml, kXmlItem parent, const kChar* path, k32f value);
961 
962 /**
963  * Sets XML child node content from a k64f value.
964  *
965  * @public @memberof kXml
966  * @param xml XML document.
967  * @param parent Parent node.
968  * @param path Path relative to the parent node.
969  * @param value Numeric value.
970  * @return Operation status.
971  */
972 kFx(kStatus) kXml_SetChild64f(kXml xml, kXmlItem parent, const kChar* path, k64f value);
973 
974 /**
975  * Reports whether a specific attribute exists for the given XML element.
976  *
977  * @public @memberof kXml
978  * @param xml XML document.
979  * @param item Element node.
980  * @param name Attribute name.
981  * @return kTRUE if attribute exists. kFALSE otherwise.
982  */
983 kFx(kBool) kXml_AttrExists(kXml xml, kXmlItem item, const kChar* name);
984 
985 /**
986  * Returns the number of attributes for the given XML element.
987  *
988  * @public @memberof kXml
989  * @param xml XML document.
990  * @param item Element node.
991  * @return Number of attributes.
992  */
993 kFx(kSize) kXml_AttrCount(kXml xml, kXmlItem item);
994 
995 /**
996  * Returns an attribute at a specific index within the list of attributes for the given element node.
997  *
998  * @public @memberof kXml
999  * @param xml XML document.
1000  * @param item Element node.
1001  * @param index Attribute index.
1002  * @return Operation status.
1003  */
1004 kFx(const kChar*) kXml_AttrNameAt(kXml xml, kXmlItem item, kSize index);
1005 
1006 /**
1007  * Deletes an XML attribute.
1008  *
1009  * @public @memberof kXml
1010  * @param xml XML document.
1011  * @param item Element node.
1012  * @param name Attribute name.
1013  * @return Operation status.
1014  */
1015 kFx(kStatus) kXml_DeleteAttr(kXml xml, kXmlItem item, const kChar* name);
1016 
1017 /**
1018  * Deletes all XML attributes.
1019  *
1020  * @public @memberof kXml
1021  * @param xml XML document.
1022  * @param item Element node.
1023  * @return Operation status.
1024  */
1025 kFx(kStatus) kXml_DeleteAttrs(kXml xml, kXmlItem item);
1026 
1027 /**
1028  * Gets XML attribute content as a character array.
1029  *
1030  * @public @memberof kXml
1031  * @param xml XML document.
1032  * @param item Element node.
1033  * @param name Attribute name.
1034  * @param str Character array.
1035  * @return Operation status.
1036  */
1037 kFx(kStatus) kXml_AttrStringZen(kXml xml, kXmlItem item, const kChar* name, kChar** str);
1038 
1039 /**
1040  * Gets XML attribute content as a string object.
1041  *
1042  * @public @memberof kXml
1043  * @param xml XML document.
1044  * @param item Element node.
1045  * @param name Attribute name.
1046  * @param string String object.
1047  * @return Operation status.
1048  */
1049 kFx(kStatus) kXml_AttrString(kXml xml, kXmlItem item, const kChar* name, kString string);
1050 
1051 /**
1052  * Gets XML attribute content as a character array.
1053  *
1054  * @public @memberof kXml
1055  * @param xml XML document.
1056  * @param item Element node.
1057  * @param name Attribute name.
1058  * @param str Character array.
1059  * @param capacity Character array capacity, in bytes (includes null-terminator).
1060  * @return Operation status.
1061  */
1062 kFx(kStatus) kXml_AttrText(kXml xml, kXmlItem item, const kChar* name, kChar* str, kSize capacity);
1063 
1064 /**
1065  * Gets XML attribute content as a k16u value.
1066  *
1067  * @public @memberof kXml
1068  * @param xml XML document.
1069  * @param item Element node.
1070  * @param name Attribute name.
1071  * @param value Returns attribute content as a numeric value.
1072  * @return Operation status.
1073  */
1074 kFx(kStatus) kXml_Attr16u(kXml xml, kXmlItem item, const kChar* name, k16u* value);
1075 
1076 /**
1077  * Gets XML attribute content as a k16s value.
1078  *
1079  * @public @memberof kXml
1080  * @param xml XML document.
1081  * @param item Element node.
1082  * @param name Attribute name.
1083  * @param value Returns attribute content as a numeric value.
1084  * @return Operation status.
1085  */
1086 kFx(kStatus) kXml_Attr16s(kXml xml, kXmlItem item, const kChar* name, k16s* value);
1087 
1088 /**
1089  * Gets XML attribute content as a k32u value.
1090  *
1091  * @public @memberof kXml
1092  * @param xml XML document.
1093  * @param item Element node.
1094  * @param name Attribute name.
1095  * @param value Returns attribute content as a numeric value.
1096  * @return Operation status.
1097  */
1098 kFx(kStatus) kXml_Attr32u(kXml xml, kXmlItem item, const kChar* name, k32u* value);
1099 
1100 /**
1101  * Gets XML attribute content as a k32s value.
1102  *
1103  * @public @memberof kXml
1104  * @param xml XML document.
1105  * @param item Element node.
1106  * @param name Attribute name.
1107  * @param value Returns attribute content as a numeric value.
1108  * @return Operation status.
1109  */
1110 kFx(kStatus) kXml_Attr32s(kXml xml, kXmlItem item, const kChar* name, k32s* value);
1111 
1112 /**
1113  * Gets XML attribute content as a kBool value.
1114  *
1115  * @public @memberof kXml
1116  * @param xml XML document.
1117  * @param item Element node.
1118  * @param name Attribute name.
1119  * @param value Returns attribute content as a boolean value.
1120  * @return Operation status.
1121  */
1122 kFx(kStatus) kXml_AttrBool(kXml xml, kXmlItem item, const kChar* name, kBool* value);
1123 
1124 /**
1125  * Gets XML attribute content as a k64u value.
1126  *
1127  * @public @memberof kXml
1128  * @param xml XML document.
1129  * @param item Element node.
1130  * @param name Attribute name.
1131  * @param value Returns attribute content as a numeric value.
1132  * @return Operation status.
1133  */
1134 kFx(kStatus) kXml_Attr64u(kXml xml, kXmlItem item, const kChar* name, k64u* value);
1135 
1136 /**
1137  * Gets XML attribute content as a k64s value.
1138  *
1139  * @public @memberof kXml
1140  * @param xml XML document.
1141  * @param item Element node.
1142  * @param name Attribute name.
1143  * @param value Returns attribute content as a numeric value.
1144  * @return Operation status.
1145  */
1146 kFx(kStatus) kXml_Attr64s(kXml xml, kXmlItem item, const kChar* name, k64s* value);
1147 
1148 /**
1149  * Gets XML attribute content as a kSize value.
1150  *
1151  * @public @memberof kXml
1152  * @param xml XML document.
1153  * @param item Element node.
1154  * @param name Attribute name.
1155  * @param value Returns attribute content as a numeric value.
1156  * @return Operation status.
1157  */
1158 kFx(kStatus) kXml_AttrSize(kXml xml, kXmlItem item, const kChar* name, kSize* value);
1159 
1160 /**
1161  * Gets XML attribute content as a k32f value.
1162  *
1163  * @public @memberof kXml
1164  * @param xml XML document.
1165  * @param item Element node.
1166  * @param name Attribute name.
1167  * @param value Returns attribute content as a numeric value.
1168  * @return Operation status.
1169  */
1170 kFx(kStatus) kXml_Attr32f(kXml xml, kXmlItem item, const kChar* name, k32f* value);
1171 
1172 /**
1173  * Gets XML attribute content as a k64f value.
1174  *
1175  * @public @memberof kXml
1176  * @param xml XML document.
1177  * @param item Element node.
1178  * @param name Attribute name.
1179  * @param value Returns attribute content as a numeric value.
1180  * @return Operation status.
1181  */
1182 kFx(kStatus) kXml_Attr64f(kXml xml, kXmlItem item, const kChar* name, k64f* value);
1183 
1184 /**
1185  * Sets XML attribute content from a character array.
1186  *
1187  * @public @memberof kXml
1188  * @param xml XML document.
1189  * @param item Element node.
1190  * @param name Attribute name.
1191  * @param str Character array.
1192  * @return Operation status.
1193  */
1194 kFx(kStatus) kXml_SetAttrText(kXml xml, kXmlItem item, const kChar* name, const kChar* str);
1195 
1196 /**
1197  * Sets XML attribute content from a k16u value.
1198  *
1199  * @public @memberof kXml
1200  * @param xml XML document.
1201  * @param item Element node.
1202  * @param name Attribute name.
1203  * @param value Numeric value.
1204  * @return Operation status.
1205  */
1206 kFx(kStatus) kXml_SetAttr16u(kXml xml, kXmlItem item, const kChar* name, k16u value);
1207 
1208 /**
1209  * Sets XML attribute content from a k16s value.
1210  *
1211  * @public @memberof kXml
1212  * @param xml XML document.
1213  * @param item Element node.
1214  * @param name Attribute name.
1215  * @param value Numeric value.
1216  * @return Operation status.
1217  */
1218 kFx(kStatus) kXml_SetAttr16s(kXml xml, kXmlItem item, const kChar* name, k16s value);
1219 
1220 /**
1221  * Sets XML attribute content from a k32u value.
1222  *
1223  * @public @memberof kXml
1224  * @param xml XML document.
1225  * @param item Element node.
1226  * @param name Attribute name.
1227  * @param value Numeric value.
1228  * @return Operation status.
1229  */
1230 kFx(kStatus) kXml_SetAttr32u(kXml xml, kXmlItem item, const kChar* name, k32u value);
1231 
1232 /**
1233  * Sets XML attribute content from a k32s value.
1234  *
1235  * @public @memberof kXml
1236  * @param xml XML document.
1237  * @param item Element node.
1238  * @param name Attribute name.
1239  * @param value Numeric value.
1240  * @return Operation status.
1241  */
1242 kFx(kStatus) kXml_SetAttr32s(kXml xml, kXmlItem item, const kChar* name, k32s value);
1243 
1244 /**
1245  * Sets XML attribute content from a kBool value.
1246  *
1247  * @public @memberof kXml
1248  * @param xml XML document.
1249  * @param item Element node.
1250  * @param name Attribute name.
1251  * @param value Boolean value.
1252  * @return Operation status.
1253  */
1254 kFx(kStatus) kXml_SetAttrBool(kXml xml, kXmlItem item, const kChar* name, kBool value);
1255 
1256 /**
1257  * Sets XML attribute content from a k64u value.
1258  *
1259  * @public @memberof kXml
1260  * @param xml XML document.
1261  * @param item Element node.
1262  * @param name Attribute name.
1263  * @param value Numeric value.
1264  * @return Operation status.
1265  */
1266 kFx(kStatus) kXml_SetAttr64u(kXml xml, kXmlItem item, const kChar* name, k64u value);
1267 
1268 /**
1269  * Sets XML attribute content from a k64s value.
1270  *
1271  * @public @memberof kXml
1272  * @param xml XML document.
1273  * @param item Element node.
1274  * @param name Attribute name.
1275  * @param value Numeric value.
1276  * @return Operation status.
1277  */
1278 kFx(kStatus) kXml_SetAttr64s(kXml xml, kXmlItem item, const kChar* name, k64s value);
1279 
1280 /**
1281  * Sets XML attribute content from a kSize value.
1282  *
1283  * @public @memberof kXml
1284  * @param xml XML document.
1285  * @param item Element node.
1286  * @param name Attribute name.
1287  * @param value Numeric value.
1288  * @return Operation status.
1289  */
1290 kFx(kStatus) kXml_SetAttrSize(kXml xml, kXmlItem item, const kChar* name, kSize value);
1291 
1292 /**
1293  * Sets XML attribute content from a k32f value.
1294  *
1295  * @public @memberof kXml
1296  * @param xml XML document.
1297  * @param item Element node.
1298  * @param name Attribute name.
1299  * @param value Numeric value.
1300  * @return Operation status.
1301  */
1302 kFx(kStatus) kXml_SetAttr32f(kXml xml, kXmlItem item, const kChar* name, k32f value);
1303 
1304 /**
1305  * Sets XML attribute content from a k64f value.
1306  *
1307  * @public @memberof kXml
1308  * @param xml XML document.
1309  * @param item Element node.
1310  * @param name Attribute name.
1311  * @param value Numeric value.
1312  * @return Operation status.
1313  */
1314 kFx(kStatus) kXml_SetAttr64f(kXml xml, kXmlItem item, const kChar* name, k64f value);
1315 
1316 kEndHeader()
1317 
1318 #include <kApi/Data/kXml.x.h>
1319 
1320 #endif
1321 
kStatus kXml_SetItemBool(kXml xml, kXmlItem item, kBool value)
Sets XML element node content from a kBool value.
kStatus kXml_Clear(kXml xml)
Removes all elements from the XML document.
kStatus kXml_Child32s(kXml xml, kXmlItem parent, const kChar *path, k32s *value)
Gets XML child node content as a k32s value.
kStatus kXml_ItemText(kXml xml, kXmlItem item, kChar *str, kSize capacity)
Gets XML element content as a character array.
Represents a 32-bit unsigned integer.
kStatus kXml_SetAttr32s(kXml xml, kXmlItem item, const kChar *name, k32s value)
Sets XML attribute content from a k32s value.
kStatus kXml_Item16u(kXml xml, kXmlItem item, k16u *value)
Gets XML element node content as a k16u value.
kStatus kXml_ChildSize(kXml xml, kXmlItem parent, const kChar *path, kSize *value)
Gets XML child node content as a kSize value.
kStatus kXml_AttrString(kXml xml, kXmlItem item, const kChar *name, kString string)
Gets XML attribute content as a string object.
kStatus kXml_FromString(kXml xml, kString str)
Loads an XML document from a string object.
Represents a 64-bit unsigned integer.
kStatus kXml_SetAttr32f(kXml xml, kXmlItem item, const kChar *name, k32f value)
Sets XML attribute content from a k32f value.
kStatus kXml_OverwriteItem(kXml xml, kXmlItem destItem, kXml srcXml, kXmlItem srcItem)
Copies a node from one XML document to another XML document, overwriting an existing element...
kStatus kXml_ChildText(kXml xml, kXmlItem parent, const kChar *path, kChar *str, kSize capacity)
Gets XML child node content as a character array.
kStatus kXml_SaveBytes(kXml xml, kByte **data, kSize *size, kAlloc allocator)
Saves an XML document to an in-memory file.
Represents a 16-bit unsigned integer.
kStatus kXml_SetItem64u(kXml xml, kXmlItem item, k64u value)
Sets XML element node content from a k64u value.
kBool kXml_AttrExists(kXml xml, kXmlItem item, const kChar *name)
Reports whether a specific attribute exists for the given XML element.
Represents an unsigned integer that can store a pointer address.
Abstract base class for memory allocator types.
kStatus kXml_DeleteAttr(kXml xml, kXmlItem item, const kChar *name)
Deletes an XML attribute.
kStatus kXml_Item32f(kXml xml, kXmlItem item, k32f *value)
Gets XML element node content as a k32f value.
kStatus kXml_SetChild64f(kXml xml, kXmlItem parent, const kChar *path, k64f value)
Sets XML child node content from a k64f value.
kXmlItem kXml_FirstChild(kXml xml, kXmlItem parent)
Returns the first child element of the given parent node.
kStatus kXml_SetItem64f(kXml xml, kXmlItem item, k64f value)
Sets XML element node content from a k64f value.
kStatus kXml_SetChild16s(kXml xml, kXmlItem parent, const kChar *path, k16s value)
Sets XML child node content from a k16s value.
const kChar * kXml_AttrNameAt(kXml xml, kXmlItem item, kSize index)
Returns an attribute at a specific index within the list of attributes for the given element node...
kStatus kXml_Attr32u(kXml xml, kXmlItem item, const kChar *name, k32u *value)
Gets XML attribute content as a k32u value.
kStatus kXml_SetAttr64f(kXml xml, kXmlItem item, const kChar *name, k64f value)
Sets XML attribute content from a k64f value.
kStatus kXml_Attr64u(kXml xml, kXmlItem item, const kChar *name, k64u *value)
Gets XML attribute content as a k64u value.
kStatus kXml_SetAttrSize(kXml xml, kXmlItem item, const kChar *name, kSize value)
Sets XML attribute content from a kSize value.
kStatus kXml_SetAttrBool(kXml xml, kXmlItem item, const kChar *name, kBool value)
Sets XML attribute content from a kBool value.
kStatus kXml_ItemString(kXml xml, kXmlItem item, kString str)
Gets XML element node content as a string object.
kStatus kXml_SetItemSize(kXml xml, kXmlItem item, kSize value)
Sets XML element node content from a kSize value.
kStatus kXml_Child32u(kXml xml, kXmlItem parent, const kChar *path, k32u *value)
Gets XML child node content as a k32u value.
kStatus kXml_SetChild32s(kXml xml, kXmlItem parent, const kChar *path, k32s value)
Sets XML child node content from a k32s value.
Represents a single unit (byte) in a UTF-8 character.
kSize kXml_ChildCount(kXml xml, kXmlItem parent)
Returns the number of child nodes for the given parent node.
kStatus kXml_ItemSize(kXml xml, kXmlItem item, kSize *value)
Gets XML element node content as a kSize value.
Represents a byte on the current platform.
kStatus kXml_Attr16u(kXml xml, kXmlItem item, const kChar *name, k16u *value)
Gets XML attribute content as a k16u value.
kStatus kXml_SetChild32f(kXml xml, kXmlItem parent, const kChar *path, k32f value)
Sets XML child node content from a k32f value.
kStatus kXml_Item16s(kXml xml, kXmlItem item, k16s *value)
Gets XML element node content as a k16s value.
kStatus kXml_AttrSize(kXml xml, kXmlItem item, const kChar *name, kSize *value)
Gets XML attribute content as a kSize value.
kStatus kXml_SetItem64s(kXml xml, kXmlItem item, k64s value)
Sets XML element node content from a k64s value.
kStatus kXml_AttrText(kXml xml, kXmlItem item, const kChar *name, kChar *str, kSize capacity)
Gets XML attribute content as a character array.
kStatus kXml_SetAttr64u(kXml xml, kXmlItem item, const kChar *name, k64u value)
Sets XML attribute content from a k64u value.
kStatus kXml_Save(kXml xml, const kChar *fileName)
Saves the XML document object to file.
kStatus kXml_Item32u(kXml xml, kXmlItem item, k32u *value)
Gets XML element node content as a k32u value.
kXmlItem kXml_Root(kXml xml)
Returns the root element of the XML document.
kStatus kXml_Item64u(kXml xml, kXmlItem item, k64u *value)
Gets XML element node content as a k64u value.
kStatus kXml_SetAttr16u(kXml xml, kXmlItem item, const kChar *name, k16u value)
Sets XML attribute content from a k16u value.
kStatus kXml_SetChild64s(kXml xml, kXmlItem parent, const kChar *path, k64s value)
Sets XML child node content from a k64s value.
kStatus kXml_Attr16s(kXml xml, kXmlItem item, const kChar *name, k16s *value)
Gets XML attribute content as a k16s value.
kStatus kXml_InsertItem(kXml xml, kXmlItem before, const kChar *name, kXmlItem *item)
Inserts a new node before the specified sibling node.
kStatus kXml_Compact(kXml xml)
Compacts the XML object for minimum memory usage.
kStatus kXml_AddItem(kXml xml, kXmlItem parent, const kChar *name, kXmlItem *item)
Inserts a new child node at the end of the specified parent node's child list.
kStatus kXml_SetAttr64s(kXml xml, kXmlItem item, const kChar *name, k64s value)
Sets XML attribute content from a k64s value.
kStatus kXml_Read(kXml xml, kStream stream)
Loads an XML document from a stream.
const kChar * kXml_ItemName(kXml xml, kXmlItem item)
Returns the name of an XML element node.
kStatus kXml_SetItem32u(kXml xml, kXmlItem item, k32u value)
Sets XML element node content from a k32u value.
kStatus kXml_Child16s(kXml xml, kXmlItem parent, const kChar *path, k16s *value)
Gets XML child node content as a k16s value.
kXmlItem kXml_ChildAt(kXml xml, kXmlItem parent, kSize index)
Returns a child node at a specific index within the list of child nodes for the given parent node...
kStatus kXml_AttrStringZen(kXml xml, kXmlItem item, const kChar *name, kChar **str)
Gets XML attribute content as a character array.
kStatus kXml_SetAttrText(kXml xml, kXmlItem item, const kChar *name, const kChar *str)
Sets XML attribute content from a character array.
kStatus kXml_Child64f(kXml xml, kXmlItem parent, const kChar *path, k64f *value)
Gets XML child node content as a k64f value.
kStatus kXml_Load(kXml *xml, const kChar *fileName, kAlloc allocator)
Loads an XML document from file.
kStatus kXml_Child64u(kXml xml, kXmlItem parent, const kChar *path, k64u *value)
Gets XML child node content as a k64u value.
kStatus kXml_ChildString(kXml xml, kXmlItem parent, const kChar *path, kString str)
Gets XML child node content as a string object.
kStatus kXml_EnsureChildExists(kXml xml, kXmlItem parent, const kChar *path, kXmlItem *item)
Creates a child node at the specified path.
Essential API declarations.
kStatus kXml_Item32s(kXml xml, kXmlItem item, k32s *value)
Gets XML element node content as a k32s value.
Represents an I/O stream.
kXmlItem kXml_Child(kXml xml, kXmlItem parent, const kChar *path)
Returns the child node at the given relative path.
kStatus kXml_Child16u(kXml xml, kXmlItem parent, const kChar *path, k16u *value)
Gets XML child node content as a k16u value.
Represents a 32-bit signed integer.
kStatus kXml_DeleteItem(kXml xml, kXmlItem item)
Deletes an XML element node.
kStatus kXml_Child64s(kXml xml, kXmlItem parent, const kChar *path, k64s *value)
Gets XML child node content as a k64s value.
kStatus kXml_SetChildText(kXml xml, kXmlItem parent, const kChar *path, const kChar *str)
Sets XML child node content from a character array.
kStatus kXml_Construct(kXml *xml, kAlloc allocator)
Represents an XML element within an XML document.
kStatus kXml_FromText(kXml *xml, const kChar *str, kAlloc allocator)
Loads an XML document from a character array.
kStatus kXml_SetChild64u(kXml xml, kXmlItem parent, const kChar *path, k64u value)
Sets XML child node content from a k64u value.
kStatus kXml_SetItem32f(kXml xml, kXmlItem item, k32f value)
Sets XML element node content from a k32f value.
kStatus kXml_SetItemText(kXml xml, kXmlItem item, const kChar *str)
Sets XML element node content from a character array.
kStatus kXml_SetChild16u(kXml xml, kXmlItem parent, const kChar *path, k16u value)
Sets XML child node content from a k16u value.
kStatus kXml_Attr32f(kXml xml, kXmlItem item, const kChar *name, k32f *value)
Gets XML attribute content as a k32f value.
kStatus kXml_SetAttr32u(kXml xml, kXmlItem item, const kChar *name, k32u value)
Sets XML attribute content from a k32u value.
kStatus kXml_Attr64s(kXml xml, kXmlItem item, const kChar *name, k64s *value)
Gets XML attribute content as a k64s value.
kStatus kXml_SetAttr16s(kXml xml, kXmlItem item, const kChar *name, k16s value)
Sets XML attribute content from a k16s value.
Represents a 64-bit signed integer.
Represents an XML document.
kStatus kXml_ChildStringZen(kXml xml, kXmlItem parent, const kChar *path, kChar **str)
Gets XML element node content as a character array.
kStatus kXml_Item64s(kXml xml, kXmlItem item, k64s *value)
Gets XML element node content as a k64s value.
Represents a character string.
kStatus kXml_DeleteAttrs(kXml xml, kXmlItem item)
Deletes all XML attributes.
kStatus kXml_ToString(kXml xml, kString str)
Exports the XML document to a string object.
kStatus kXml_SetChildSize(kXml xml, kXmlItem parent, const kChar *path, kSize value)
Sets XML child node content from a kSize value.
kXmlItem kXml_NextSibling(kXml xml, kXmlItem item)
Returns the next sibling element of the given element node.
kStatus kXml_SetItemName(kXml xml, kXmlItem item, const kChar *name)
Sets the name of an XML element node.
kStatus kXml_ItemStringZen(kXml xml, kXmlItem item, kChar **str)
Gets XML element content as a character array.
kStatus kXml_Item64f(kXml xml, kXmlItem item, k64f *value)
Gets XML element node content as a k64f value.
kBool kXml_ChildExists(kXml xml, kXmlItem parent, const kChar *path)
Reports whether a child node exists at the specified relative path.
Represents a 16-bit signed integer.
kStatus kXml_ChildBool(kXml xml, kXmlItem parent, const kChar *path, kBool *value)
Gets XML child node content as a kBool value.
Represents a 32-bit floating-point number.
kStatus kXml_SetItem32s(kXml xml, kXmlItem item, k32s value)
Sets XML element node content from a k32s value.
kStatus kXml_SetChildBool(kXml xml, kXmlItem parent, const kChar *path, kBool value)
Sets XML child node content from a kBool value.
kStatus kXml_Child32f(kXml xml, kXmlItem parent, const kChar *path, k32f *value)
Gets XML child node content as a k32f value.
kStatus kXml_DeleteChildren(kXml xml, kXmlItem item)
Deletes all children in the specified parent item.
Represents an enumeration of error codes.
kStatus kXml_SetItem16u(kXml xml, kXmlItem item, k16u value)
Sets XML element node content from a k16u value.
kXmlItem kXml_PreviousSibling(kXml xml, kXmlItem item)
Returns the previous sibling element of the given element node.
kStatus kXml_CopyItem(kXml xml, kXmlItem parent, kXmlItem before, kXml srcXml, kXmlItem srcItem, kXmlItem *item)
Copies a node from one XML document to another XML document, inserting a new node a specified locatio...
kStatus kXml_FindRoot(kXml xml, kXmlItem *root)
Finds the root node, if it exists.
kStatus kXml_ItemBool(kXml xml, kXmlItem item, kBool *value)
Gets XML element node content as a kBool value.
kStatus kXml_LoadBytes(kXml *xml, const kByte *data, kSize size, kAlloc allocator)
Loads an XML document from an in-memory file.
kSize kXml_AttrCount(kXml xml, kXmlItem item)
Returns the number of attributes for the given XML element.
kStatus kXml_FindChild(kXml xml, kXmlItem parent, const kChar *path, kXmlItem *child)
Finds the child node at the given relative path, if it exists.
Represents a 64-bit floating-point number.
kStatus kXml_Write(kXml xml, kStream stream)
Writes an XML document to a stream.
kStatus kXml_Attr64f(kXml xml, kXmlItem item, const kChar *name, k64f *value)
Gets XML attribute content as a k64f value.
kXmlItem kXml_LastChild(kXml xml, kXmlItem parent)
Returns the last child element of the given parent node.
kStatus kXml_SetChild32u(kXml xml, kXmlItem parent, const kChar *path, k32u value)
Sets XML child node content from a k32u value.
Represents a boolean value.
kXmlItem kXml_Parent(kXml xml, kXmlItem item)
Returns the parent node of the given element.
kStatus kXml_ClearItem(kXml xml, kXmlItem item)
Removes all children, attributes, and value from the XML element node.
kStatus kXml_AttrBool(kXml xml, kXmlItem item, const kChar *name, kBool *value)
Gets XML attribute content as a kBool value.
kStatus kXml_SetItem16s(kXml xml, kXmlItem item, k16s value)
Sets XML element node content from a k16s value.
kStatus kXml_Attr32s(kXml xml, kXmlItem item, const kChar *name, k32s *value)
Gets XML attribute content as a k32s value.
kStatus kXml_Assign(kXml xml, kXml source)
Copies the source document.