Zen API

- Home
- Help Topics
- Types by Category
- All Types
- Files

All Classes Files Functions Variables Typedefs Macros Groups Pages
kSerializer.h
Go to the documentation of this file.
1 /**
2 * @file kSerializer.h
3 * @brief Declares the kSerializer class.
4 *
5 * @internal
6 * Copyright (C) 2005-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_SERIALIZER_H
11 #define K_API_SERIALIZER_H
12
13 #include <kApi/kApiDef.h>
14
15 kBeginHeader()
16
17 /**
18 * @class kSerializer
19 * @extends kObject
20 * @ingroup kApi-Io
21 * @brief Base class for serialization/deserialization classes.
22 *
23 * kSerializer is base class for serialization/deserialization classes, where each base
24 * class implements a specific object serialization format.
25 *
26 * kSerializer itself is also an instantiable class. The kSerializer base class does not provide
27 * the ability to serialize/deserialize objects or type information, but can be used to
28 * read/write primitive data and arrays.
29 *
30 */
31 //typedef kObject kSerializer; --forward-declared in kApiDef.x.h
32
33 /**
34 * Constructs a serializer object using the specified serialization format.
35 *
36 * This method is a factory constructor; the type of serializer to be instantiated is provided
37 * as an argument. If no serializer type is provided, the default serializer will be used
38 * (currently kSerializer).
39 *
40 * @public @memberof kSerializer
41 * @param serializer Serializer object.
42 * @param stream Stream for reading/writing.
43 * @param serializerType Serializer type (or kNULL for default).
44 * @param allocator Memory allocator (or kNULL for default).
45 * @return Operation status.
46 */
47 kFx(kStatus) kSerializer_Construct(kSerializer* serializer, kStream stream, kType serializerType, kAlloc allocator);
48
49 /**
50 * Loads an object from file using the specified serializer type.
51 *
52 * @public @memberof kSerializer
53 * @param object Receives deserialized object.
54 * @param serializerType Type of serializer to use (e.g. kDat6Serializer).
55 * @param filePath Path of the file to load.
56 * @param readAlloc Memory allocator to use for loaded object (or kNULL for default).
57 * @return Operation status.
58 */
59 kFx(kStatus) kSerializer_LoadObject(kObject* object, kType serializerType, const kChar* filePath, kAlloc readAlloc);
60
61 /**
62 * Saves an object to file using the specified serializer type.
63 *
64 * @public @memberof kSerializer
65 * @param object Object to be serialized.
66 * @param serializerType Type of serializer to use (e.g. kDat6Serializer).
67 * @param filePath Path of the file to save.
68 * @return Operation status.
69 */
70 kFx(kStatus) kSerializer_SaveObject(kObject object, kType serializerType, const kChar* filePath);
71
72 /**
73 * Sets the version to use when serializing types.
74 *
75 * Some serialization formats use a versioning scheme in which a separate version is given
76 * for each assembly, while others use a single version that is applied to types from all
77 * assemblies. If a single version is used for assemblies, set the assembly argument to null.
78 *
79 * @public @memberof kSerializer
80 * @param serializer Serializer object.
81 * @param assembly Assembly object (or kNULL).
82 * @param version Desired version.
83 * @return Operation status.
84 */
85 kFx(kStatus) kSerializer_SetVersion(kSerializer serializer, kAssembly assembly, kVersion version);
86
87 /**
88 * Explicitly sets the number of bytes used to encode/decode kSize and kSSize values.
89 *
90 * The default size encoding for kSerializer is 4 bytes. However this value can be overridden by
91 * derived classes.
92 *
93 * @public @memberof kSerializer
94 * @param serializer Serializer object.
95 * @param byteCount Number of bytes to use when encoding size values (accepts 4 or 8).
96 * @return Operation status.
97 */
98 kFx(kStatus) kSerializer_SetSizeEncoding(kSerializer serializer, k32u byteCount);
99
100 /**
101 * Writes an object to the underlying stream.
102 *
103 * @public @memberof kSerializer
104 * @param serializer Serializer object.
105 * @param object Object to be serialized.
106 * @return Operation status.
107 */
108 kFx(kStatus) kSerializer_WriteObject(kSerializer serializer, kObject object);
109
110 /**
111 * Reads an object from the underlying stream.
112 *
113 * @public @memberof kSerializer
114 * @param serializer Serializer object.
115 * @param object Receives deserialized object.
116 * @param allocator Memory allocator (or kNULL for default).
117 * @return Operation status.
118 */
119 kFx(kStatus) kSerializer_ReadObject(kSerializer serializer, kObject* object, kAlloc allocator);
120
121 /**
122 * Writes a null-terminated kChar array.
123 *
124 * @public @memberof kSerializer
125 * @param serializer Serializer object.
126 * @param data String to write.
127 * @return Operation status.
128 */
129 kFx(kStatus) kSerializer_WriteText(kSerializer serializer, const kChar* data);
130
131 /**
132 * Reads a null-terminated kChar array.
133 *
134 * @public @memberof kSerializer
135 * @param serializer Serializer object.
136 * @param data Receives the string.
137 * @param capacity Capacity of data string (including null terminator; must be greater than zero).
138 * @return Operation status.
139 */
140 kFx(kStatus) kSerializer_ReadText(kSerializer serializer, kChar* data, kSize capacity);
141
142 /**
143 * Writes a kByte value.
144 *
145 * @public @memberof kSerializer
146 * @param serializer Serializer object.
147 * @param data Value to write.
148 * @return Operation status.
149 */
150 kFx(kStatus) kSerializer_WriteByte(kSerializer serializer, kByte data);
151
152 /**
153 * Writes a kByte array.
154 *
155 * @public @memberof kSerializer
156 * @param serializer Serializer object.
157 * @param data Array to write.
158 * @param count Count of array elements.
159 * @return Operation status.
160 */
161 kFx(kStatus) kSerializer_WriteByteArray(kSerializer serializer, const kByte* data, kSize count);
162
163 /**
164 * Reads a kByte value.
165 *
166 * @public @memberof kSerializer
167 * @param serializer Serializer object.
168 * @param data Receives the value.
169 * @return Operation status.
170 */
171 kFx(kStatus) kSerializer_ReadByte(kSerializer serializer, kByte* data);
172
173 /**
174 * Reads a kByte array.
175 *
176 * @public @memberof kSerializer
177 * @param serializer Serializer object.
178 * @param data Receives the array elements.
179 * @param count Count of array elements to read.
180 * @return Operation status.
181 */
182 kFx(kStatus) kSerializer_ReadByteArray(kSerializer serializer, kByte* data, kSize count);
183
184 /**
185 * Writes a kChar value.
186 *
187 * @public @memberof kSerializer
188 * @param serializer Serializer object.
189 * @param data Value to write.
190 * @return Operation status.
191 */
192 kFx(kStatus) kSerializer_WriteChar(kSerializer serializer, kChar data);
193
194 /**
195 * Writes a kChar array.
196 *
197 * @public @memberof kSerializer
198 * @param serializer Serializer object.
199 * @param data Array to write.
200 * @param count Count of array elements.
201 * @return Operation status.
202 */
203 kFx(kStatus) kSerializer_WriteCharArray(kSerializer serializer, const kChar* data, kSize count);
204
205 /**
206 * Reads a kChar value.
207 *
208 * @public @memberof kSerializer
209 * @param serializer Serializer object.
210 * @param data Receives the value.
211 * @return Operation status.
212 */
213 kFx(kStatus) kSerializer_ReadChar(kSerializer serializer, kChar* data);
214
215 /**
216 * Reads a kChar array.
217 *
218 * @public @memberof kSerializer
219 * @param serializer Serializer object.
220 * @param data Receives the array elements.
221 * @param count Count of array elements to read.
222 * @return Operation status.
223 */
224 kFx(kStatus) kSerializer_ReadCharArray(kSerializer serializer, kChar* data, kSize count);
225
226 /**
227 * Writes a k8u value.
228 *
229 * @public @memberof kSerializer
230 * @param serializer Serializer object.
231 * @param data Value to write.
232 * @return Operation status.
233 */
234 kFx(kStatus) kSerializer_Write8u(kSerializer serializer, k8u data);
235
236 /**
237 * Writes a k8u array.
238 *
239 * @public @memberof kSerializer
240 * @param serializer Serializer object.
241 * @param data Array to write.
242 * @param count Count of array elements.
243 * @return Operation status.
244 */
245 kFx(kStatus) kSerializer_Write8uArray(kSerializer serializer, const k8u* data, kSize count);
246
247 /**
248 * Reads a k8u value.
249 *
250 * @public @memberof kSerializer
251 * @param serializer Serializer object.
252 * @param data Receives the value.
253 * @return Operation status.
254 */
255 kFx(kStatus) kSerializer_Read8u(kSerializer serializer, k8u* data);
256
257 /**
258 * Reads a k8u array.
259 *
260 * @public @memberof kSerializer
261 * @param serializer Serializer object.
262 * @param data Receives the array elements.
263 * @param count Count of array elements to read.
264 * @return Operation status.
265 */
266 kFx(kStatus) kSerializer_Read8uArray(kSerializer serializer, k8u* data, kSize count);
267
268 /**
269 * Writes a k8s value.
270 *
271 * @public @memberof kSerializer
272 * @param serializer Serializer object.
273 * @param data Value to write.
274 * @return Operation status.
275 */
276 kFx(kStatus) kSerializer_Write8s(kSerializer serializer, k8s data);
277
278 /**
279 * Writes a k8s array.
280 *
281 * @public @memberof kSerializer
282 * @param serializer Serializer object.
283 * @param data Array to write.
284 * @param count Count of array elements.
285 * @return Operation status.
286 */
287 kFx(kStatus) kSerializer_Write8sArray(kSerializer serializer, const k8s* data, kSize count);
288
289 /**
290 * Reads a k8s value.
291 *
292 * @public @memberof kSerializer
293 * @param serializer Serializer object.
294 * @param data Receives the value.
295 * @return Operation status.
296 */
297 kFx(kStatus) kSerializer_Read8s(kSerializer serializer, k8s* data);
298
299 /**
300 * Reads a k8s array.
301 *
302 * @public @memberof kSerializer
303 * @param serializer Serializer object.
304 * @param data Receives the array elements.
305 * @param count Count of array elements to read.
306 * @return Operation status.
307 */
308 kFx(kStatus) kSerializer_Read8sArray(kSerializer serializer, k8s* data, kSize count);
309
310 /**
311 * Writes a k16u value.
312 *
313 * @public @memberof kSerializer
314 * @param serializer Serializer object.
315 * @param data Value to write.
316 * @return Operation status.
317 */
318 kFx(kStatus) kSerializer_Write16u(kSerializer serializer, k16u data);
319
320 /**
321 * Writes a k16u array.
322 *
323 * @public @memberof kSerializer
324 * @param serializer Serializer object.
325 * @param data Array to write.
326 * @param count Count of array elements.
327 * @return Operation status.
328 */
329 kFx(kStatus) kSerializer_Write16uArray(kSerializer serializer, const k16u* data, kSize count);
330
331 /**
332 * Reads a k16u value.
333 *
334 * @public @memberof kSerializer
335 * @param serializer Serializer object.
336 * @param data Receives the value.
337 * @return Operation status.
338 */
339 kFx(kStatus) kSerializer_Read16u(kSerializer serializer, k16u* data);
340
341 /**
342 * Reads a k16u array.
343 *
344 * @public @memberof kSerializer
345 * @param serializer Serializer object.
346 * @param data Receives the array elements.
347 * @param count Count of array elements to read.
348 * @return Operation status.
349 */
350 kFx(kStatus) kSerializer_Read16uArray(kSerializer serializer, k16u* data, kSize count);
351
352 /**
353 * Writes a k16s value.
354 *
355 * @public @memberof kSerializer
356 * @param serializer Serializer object.
357 * @param data Value to write.
358 * @return Operation status.
359 */
360 kFx(kStatus) kSerializer_Write16s(kSerializer serializer, k16s data);
361
362 /**
363 * Writes a k16s array.
364 *
365 * @public @memberof kSerializer
366 * @param serializer Serializer object.
367 * @param data Array to write.
368 * @param count Count of array elements.
369 * @return Operation status.
370 */
371 kFx(kStatus) kSerializer_Write16sArray(kSerializer serializer, const k16s* data, kSize count);
372
373
374 /**
375 * Reads a k16s value.
376 *
377 * @public @memberof kSerializer
378 * @param serializer Serializer object.
379 * @param data Receives the value.
380 * @return Operation status.
381 */
382 kFx(kStatus) kSerializer_Read16s(kSerializer serializer, k16s* data);
383
384 /**
385 * Reads a k16s array.
386 *
387 * @public @memberof kSerializer
388 * @param serializer Serializer object.
389 * @param data Receives the array elements.
390 * @param count Count of array elements to read.
391 * @return Operation status.
392 */
393 kFx(kStatus) kSerializer_Read16sArray(kSerializer serializer, k16s* data, kSize count);
394
395
396 /**
397 * Writes a k32u value.
398 *
399 * @public @memberof kSerializer
400 * @param serializer Serializer object.
401 * @param data Value to write.
402 * @return Operation status.
403 */
404 kFx(kStatus) kSerializer_Write32u(kSerializer serializer, k32u data);
405
406 /**
407 * Writes a k32u array.
408 *
409 * @public @memberof kSerializer
410 * @param serializer Serializer object.
411 * @param data Array to write.
412 * @param count Count of array elements.
413 * @return Operation status.
414 */
415 kFx(kStatus) kSerializer_Write32uArray(kSerializer serializer, const k32u* data, kSize count);
416
417 /**
418 * Reads a k32u value.
419 *
420 * @public @memberof kSerializer
421 * @param serializer Serializer object.
422 * @param data Receives the value.
423 * @return Operation status.
424 */
425 kFx(kStatus) kSerializer_Read32u(kSerializer serializer, k32u* data);
426
427 /**
428 * Reads a k32u array.
429 *
430 * @public @memberof kSerializer
431 * @param serializer Serializer object.
432 * @param data Receives the array elements.
433 * @param count Count of array elements to read.
434 * @return Operation status.
435 */
436 kFx(kStatus) kSerializer_Read32uArray(kSerializer serializer, k32u* data, kSize count);
437
438 /**
439 * Writes a k32s value.
440 *
441 * @public @memberof kSerializer
442 * @param serializer Serializer object.
443 * @param data Value to write.
444 * @return Operation status.
445 */
446 kFx(kStatus) kSerializer_Write32s(kSerializer serializer, k32s data);
447
448 /**
449 * Writes a k32s array.
450 *
451 * @public @memberof kSerializer
452 * @param serializer Serializer object.
453 * @param data Array to write.
454 * @param count Count of array elements.
455 * @return Operation status.
456 */
457 kFx(kStatus) kSerializer_Write32sArray(kSerializer serializer, const k32s* data, kSize count);
458
459 /**
460 * Reads a k32s value.
461 *
462 * @public @memberof kSerializer
463 * @param serializer Serializer object.
464 * @param data Receives the value.
465 * @return Operation status.
466 */
467 kFx(kStatus) kSerializer_Read32s(kSerializer serializer, k32s* data);
468
469 /**
470 * Reads a k32s array.
471 *
472 * @public @memberof kSerializer
473 * @param serializer Serializer object.
474 * @param data Receives the array elements.
475 * @param count Count of array elements to read.
476 * @return Operation status.
477 */
478 kFx(kStatus) kSerializer_Read32sArray(kSerializer serializer, k32s* data, kSize count);
479
480 /**
481 * Writes a k64u value.
482 *
483 * @public @memberof kSerializer
484 * @param serializer Serializer object.
485 * @param data Value to write.
486 * @return Operation status.
487 */
488 kFx(kStatus) kSerializer_Write64u(kSerializer serializer, k64u data);
489
490 /**
491 * Writes a k64u array.
492 *
493 * @public @memberof kSerializer
494 * @param serializer Serializer object.
495 * @param data Array to write.
496 * @param count Count of array elements.
497 * @return Operation status.
498 */
499 kFx(kStatus) kSerializer_Write64uArray(kSerializer serializer, const k64u* data, kSize count);
500
501 /**
502 * Reads a k64u value.
503 *
504 * @public @memberof kSerializer
505 * @param serializer Serializer object.
506 * @param data Receives the value.
507 * @return Operation status.
508 */
509 kFx(kStatus) kSerializer_Read64u(kSerializer serializer, k64u* data);
510
511 /**
512 * Reads a k64u array.
513 *
514 * @public @memberof kSerializer
515 * @param serializer Serializer object.
516 * @param data Receives the array elements.
517 * @param count Count of array elements to read.
518 * @return Operation status.
519 */
520 kFx(kStatus) kSerializer_Read64uArray(kSerializer serializer, k64u* data, kSize count);
521
522 /**
523 * Writes a k64s value.
524 *
525 * @public @memberof kSerializer
526 * @param serializer Serializer object.
527 * @param data Value to write.
528 * @return Operation status.
529 */
530 kFx(kStatus) kSerializer_Write64s(kSerializer serializer, k64s data);
531
532 /**
533 * Writes a k64s array.
534 *
535 * @public @memberof kSerializer
536 * @param serializer Serializer object.
537 * @param data Array to write.
538 * @param count Count of array elements.
539 * @return Operation status.
540 */
541 kFx(kStatus) kSerializer_Write64sArray(kSerializer serializer, const k64s* data, kSize count);
542
543 /**
544 * Reads a k64s value.
545 *
546 * @public @memberof kSerializer
547 * @param serializer Serializer object.
548 * @param data Receives the value.
549 * @return Operation status.
550 */
551 kFx(kStatus) kSerializer_Read64s(kSerializer serializer, k64s* data);
552
553 /**
554 * Reads a k64s array.
555 *
556 * @public @memberof kSerializer
557 * @param serializer Serializer object.
558 * @param data Receives the array elements.
559 * @param count Count of array elements to read.
560 * @return Operation status.
561 */
562 kFx(kStatus) kSerializer_Read64sArray(kSerializer serializer, k64s* data, kSize count);
563
564 /**
565 * Writes a k32f value.
566 *
567 * @public @memberof kSerializer
568 * @param serializer Serializer object.
569 * @param data Value to write.
570 * @return Operation status.
571 */
572 kFx(kStatus) kSerializer_Write32f(kSerializer serializer, k32f data);
573
574 /**
575 * Writes a k32f array.
576 *
577 * @public @memberof kSerializer
578 * @param serializer Serializer object.
579 * @param data Array to write.
580 * @param count Count of array elements.
581 * @return Operation status.
582 */
583 kFx(kStatus) kSerializer_Write32fArray(kSerializer serializer, const k32f* data, kSize count);
584
585 /**
586 * Reads a k32f value.
587 *
588 * @public @memberof kSerializer
589 * @param serializer Serializer object.
590 * @param data Receives the value.
591 * @return Operation status.
592 */
593 kFx(kStatus) kSerializer_Read32f(kSerializer serializer, k32f* data);
594
595 /**
596 * Reads a k32f array.
597 *
598 * @public @memberof kSerializer
599 * @param serializer Serializer object.
600 * @param data Receives the array elements.
601 * @param count Count of array elements to read.
602 * @return Operation status.
603 */
604 kFx(kStatus) kSerializer_Read32fArray(kSerializer serializer, k32f* data, kSize count);
605
606 /**
607 * Writes a k64f value.
608 *
609 * @public @memberof kSerializer
610 * @param serializer Serializer object.
611 * @param data Value to write.
612 * @return Operation status.
613 */
614 kFx(kStatus) kSerializer_Write64f(kSerializer serializer, k64f data);
615
616 /**
617 * Writes a k64f array.
618 *
619 * @public @memberof kSerializer
620 * @param serializer Serializer object.
621 * @param data Array to write.
622 * @param count Count of array elements.
623 * @return Operation status.
624 */
625 kFx(kStatus) kSerializer_Write64fArray(kSerializer serializer, const k64f* data, kSize count);
626
627 /**
628 * Reads a k64f value.
629 *
630 * @public @memberof kSerializer
631 * @param serializer Serializer object.
632 * @param data Receives the value.
633 * @return Operation status.
634 */
635 kFx(kStatus) kSerializer_Read64f(kSerializer serializer, k64f* data);
636
637 /**
638 * Reads a k64f array.
639 *
640 * @public @memberof kSerializer
641 * @param serializer Serializer object.
642 * @param data Receives the array elements.
643 * @param count Count of array elements to read.
644 * @return Operation status.
645 */
646 kFx(kStatus) kSerializer_Read64fArray(kSerializer serializer, k64f* data, kSize count);
647
648 /**
649 * Writes a kSize value.
650 *
651 * This method uses the current size encoding (specified with kSerializer_SetSizeEncoding) to
652 * write the size value.
653 *
654 * @public @memberof kSerializer
655 * @param serializer Serializer object.
656 * @param data Size value.
657 * @return Operation status.
658 */
659 kFx(kStatus) kSerializer_WriteSize(kSerializer serializer, kSize data);
660
661 /**
662 * Writes a kSize array.
663 *
664 * This method uses the current size encoding (specified with kSerializer_SetSizeEncoding) to
665 * write the size values.
666 *
667 * @public @memberof kSerializer
668 * @param serializer Serializer object.
669 * @param data Array to write.
670 * @param count Count of array elements.
671 * @return Operation status.
672 */
673 kFx(kStatus) kSerializer_WriteSizeArray(kSerializer serializer, const kSize* data, kSize count);
674
675 /**
676 * Reads a kSize value.
677 *
678 * This method uses the current size encoding (specified with kSerializer_SetSizeEncoding) to
679 * read the size value.
680 *
681 * @public @memberof kSerializer
682 * @param serializer Serializer object.
683 * @param data Receives size value.
684 * @return Operation status.
685 */
686 kFx(kStatus) kSerializer_ReadSize(kSerializer serializer, kSize* data);
687
688 /**
689 * Reads a kSize array.
690 *
691 * This method uses the current size encoding (specified with kSerializer_SetSizeEncoding) to
692 * read the size values.
693 *
694 * @public @memberof kSerializer
695 * @param serializer Serializer object.
696 * @param data Receives the array elements.
697 * @param count Count of array elements to read.
698 * @return Operation status.
699 */
700 kFx(kStatus) kSerializer_ReadSizeArray(kSerializer serializer, kSize* data, kSize count);
701
702 /**
703 * Writes a kSSize value.
704 *
705 * This method uses the current size encoding (specified with kSerializer_SetSizeEncoding) to
706 * write the size value.
707 *
708 * @public @memberof kSerializer
709 * @param serializer Serializer object.
710 * @param data SSize value.
711 * @return Operation status.
712 */
713 kFx(kStatus) kSerializer_WriteSSize(kSerializer serializer, kSSize data);
714
715 /**
716 * Writes a kSSize array.
717 *
718 * This method uses the current size encoding (specified with kSerializer_SetSizeEncoding) to
719 * write the size values.
720 *
721 * @public @memberof kSerializer
722 * @param serializer Serializer object.
723 * @param data Array to write.
724 * @param count Count of array elements.
725 * @return Operation status.
726 */
727 kFx(kStatus) kSerializer_WriteSSizeArray(kSerializer serializer, const kSSize* data, kSize count);
728
729 /**
730 * Reads a kSSize value.
731 *
732 * This method uses the current size encoding (specified with kSerializer_SetSizeEncoding) to
733 * read the size value.
734 *
735 * @public @memberof kSerializer
736 * @param serializer Serializer object.
737 * @param data Receives size value.
738 * @return Operation status.
739 */
740 kFx(kStatus) kSerializer_ReadSSize(kSerializer serializer, kSSize* data);
741
742 /**
743 * Reads a kSSize array.
744 *
745 * This method uses the current size encoding (specified with kSerializer_SetSizeEncoding) to
746 * read the size values.
747 *
748 * @public @memberof kSerializer
749 * @param serializer Serializer object.
750 * @param data Receives the array elements.
751 * @param count Count of array elements to read.
752 * @return Operation status.
753 */
754 kFx(kStatus) kSerializer_ReadSSizeArray(kSerializer serializer, kSSize* data, kSize count);
755
756 /**
757 * Writes a type code.
758 *
759 * @public @memberof kSerializer
760 * @param serializer Serializer object.
761 * @param type Type instance.
762 * @param version Receives a reference to the type version that was written.
763 * @return Operation status.
764 */
765 kFx(kStatus) kSerializer_WriteType(kSerializer serializer, kType type, kTypeVersion* version);
766
767 /**
768 * Reads a type code.
769 *
770 * @public @memberof kSerializer
771 * @param serializer Serializer object.
772 * @param type Type instance.
773 * @param version Receives a reference to the type version that was read.
774 * @return Operation status.
775 */
776 kFx(kStatus) kSerializer_ReadType(kSerializer serializer, kType* type, kTypeVersion* version);
777
778 /**
779 * Writes an array of values or objects.
780 *
781 * @public @memberof kSerializer
782 * @param serializer Serializer object.
783 * @param type Type of items.
784 * @param version Type version.
785 * @param items Items to serialize.
786 * @param count Count of items.
787 * @return Operation status.
788 */
789 kFx(kStatus) kSerializer_WriteItems(kSerializer serializer, kType type, kTypeVersion version, const void* items, kSize count);
790
791 /**
792 * Reads an array of values or objects.
793 *
794 * @public @memberof kSerializer
795 * @param serializer Serializer object.
796 * @param type Type of items.
797 * @param version Type version.
798 * @param items Receives deserialized items.
799 * @param count Count of items.
800 * @return Operation status.
801 */
802 kFx(kStatus) kSerializer_ReadItems(kSerializer serializer, kType type, kTypeVersion version, void* items, kSize count);
803
804 /**
805 * Begins writing a measured section of data, using an 8, 16, 32, or 64-bit integer
806 * to record the size.
807 *
808 * @public @memberof kSerializer
809 * @param serializer Serializer object.
810 * @param sizeType Type of size field (k8u, k16u, k32u, or k64u)
811 * @param includeSize Include the size of the size field in the written size?
812 * @return Operation status.
813 */
814 kFx(kStatus) kSerializer_BeginWrite(kSerializer serializer, kType sizeType, kBool includeSize);
815
816 /**
817 * Ends writing a measured data section.
818 *
819 * @public @memberof kSerializer
820 * @param serializer Serializer object.
821 * @return Operation status.
822 */
823 kFx(kStatus) kSerializer_EndWrite(kSerializer serializer);
824
825 /**
826 * Begins reading a measured data section.
827 *
828 * @public @memberof kSerializer
829 * @param serializer Serializer object.
830 * @param sizeType Type of size field (k8u, k16u, k32u, or k64u)
831 * @param includeSize Size of the size field was included in the recorded size?
832 * @return Operation status.
833 */
834 kFx(kStatus) kSerializer_BeginRead(kSerializer serializer, kType sizeType, kBool includeSize);
835
836 /**
837 * Ends reading a measured data section.
838 *
839 * @public @memberof kSerializer
840 * @param serializer Serializer object.
841 * @return Operation status.
842 */
843 kFx(kStatus) kSerializer_EndRead(kSerializer serializer);
844
845 /**
846 * Determines whether the current measured read section has more bytes.
847 *
848 * @public @memberof kSerializer
849 * @param serializer Serializer object.
850 * @return kTRUE if no more bytes available; otherwise, kFALSE.
851 */
852 kFx(kBool) kSerializer_ReadCompleted(kSerializer serializer);
853
854 /**
855 * Reads and discards a specified number of bytes.
856 *
857 * @public @memberof kSerializer
858 * @param serializer Serializer object.
859 * @param offset Number of bytes to read and discard.
860 * @return Operation status.
861 */
862 kFx(kStatus) kSerializer_AdvanceRead(kSerializer serializer, kSize offset);
863
864 /**
865 * Flushes the serializer write buffer to the underlying stream.
866 *
867 * @public @memberof kSerializer
868 * @param serializer Serializer object.
869 * @return Operation status.
870 */
871 kFx(kStatus) kSerializer_Flush(kSerializer serializer);
872
873 /**
874 * Discards any streaming context accumulated by the serializer.
875 *
876 * @public @memberof kSerializer
877 * @param serializer Serializer object.
878 * @return Operation status.
879 */
880 kFx(kStatus) kSerializer_Reset(kSerializer serializer);
881
882 /**
883 * Gets the underlying stream.
884 *
885 * @public @memberof kSerializer
886 * @param serializer Serializer object.
887 * @return Stream object.
888 */
889 kFx(kStream) kSerializer_Stream(kSerializer serializer);
890
891 #define kSerializer_WriteObject_(S, D) kxSerializer_WriteObject_(S, D) ///< Macro version of kSerializer_WriteObject.
892 #define kSerializer_ReadObject_(S, D, A) kxSerializer_ReadObject_(S, D, A) ///< Macro version of kSerializer_ReadObject.
893
894 #define kSerializer_WriteByte_(S, D) kxSerializer_WriteByte_(S, D) ///< Macro version of kSerializer_WriteByte.
895 #define kSerializer_WriteByteArray_(S, D, C) kxSerializer_WriteByteArray_(S, D, C) ///< Macro version of kSerializer_WriteByteArray.
896 #define kSerializer_ReadByte_(S, D) kxSerializer_ReadByte_(S, D) ///< Macro version of kSerializer_ReadByte.
897 #define kSerializer_ReadByteArray_(S, D, C) kxSerializer_ReadByteArray_(S, D, C) ///< Macro version of kSerializer_ReadByteArray.
898
899 #define kSerializer_WriteChar_(S, D) kxSerializer_WriteChar_(S, D) ///< Macro version of kSerializer_WriteChar.
900 #define kSerializer_WriteCharArray_(S, D, C) kxSerializer_WriteCharArray_(S, D, C) ///< Macro version of kSerializer_WriteCharArray.
901 #define kSerializer_ReadChar_(S, D) kxSerializer_ReadChar_(S, D) ///< Macro version of kSerializer_ReadChar.
902 #define kSerializer_ReadCharArray_(S, D, C) kxSerializer_ReadCharArray_(S, D, C) ///< Macro version of kSerializer_ReadCharArray.
903
904 #define kSerializer_Write8u_(S, D) kxSerializer_Write8u_(S, D) ///< Macro version of kSerializer_Write8u.
905 #define kSerializer_Write8uArray_(S, D, C) kxSerializer_Write8uArray_(S, D, C) ///< Macro version of kSerializer_Write8uArray.
906 #define kSerializer_Read8u_(S, D) kxSerializer_Read8u_(S, D) ///< Macro version of kSerializer_Read8u.
907 #define kSerializer_Read8uArray_(S, D, C) kxSerializer_Read8uArray_(S, D, C) ///< Macro version of kSerializer_Read8uArray.
908
909 #define kSerializer_Write8s_(S, D) kxSerializer_Write8s_(S, D) ///< Macro version of kSerializer_Write8s.
910 #define kSerializer_Write8sArray_(S, D, C) kxSerializer_Write8sArray_(S, D, C) ///< Macro version of kSerializer_Write8sArray.
911 #define kSerializer_Read8s_(S, D) kxSerializer_Read8s_(S, D) ///< Macro version of kSerializer_Read8s.
912 #define kSerializer_Read8sArray_(S, D, C) kxSerializer_Read8sArray_(S, D, C) ///< Macro version of kSerializer_Read8sArray.
913
914 #define kSerializer_Write16u_(S, D) kxSerializer_Write16u_(S, D) ///< Macro version of kSerializer_Write16u.
915 #define kSerializer_Write16uArray_(S, D, C) kxSerializer_Write16uArray_(S, D, C) ///< Macro version of kSerializer_Write16uArray.
916 #define kSerializer_Read16u_(S, D) kxSerializer_Read16u_(S, D) ///< Macro version of kSerializer_Read16u.
917 #define kSerializer_Read16uArray_(S, D, C) kxSerializer_Read16uArray_(S, D, C) ///< Macro version of kSerializer_Read16uArray.
918
919 #define kSerializer_Write16s_(S, D) kxSerializer_Write16s_(S, D) ///< Macro version of kSerializer_Write16s.
920 #define kSerializer_Write16sArray_(S, D, C) kxSerializer_Write16sArray_(S, D, C) ///< Macro version of kSerializer_Write16sArray.
921 #define kSerializer_Read16s_(S, D) kxSerializer_Read16s_(S, D) ///< Macro version of kSerializer_Read16s.
922 #define kSerializer_Read16sArray_(S, D, C) kxSerializer_Read16sArray_(S, D, C) ///< Macro version of kSerializer_Read16sArray.
923
924 #define kSerializer_Write32u_(S, D) kxSerializer_Write32u_(S, D) ///< Macro version of kSerializer_Write32u.
925 #define kSerializer_Write32uArray_(S, D, C) kxSerializer_Write32uArray_(S, D, C) ///< Macro version of kSerializer_Write32uArray.
926 #define kSerializer_Read32u_(S, D) kxSerializer_Read32u_(S, D) ///< Macro version of kSerializer_Read32u.
927 #define kSerializer_Read32uArray_(S, D, C) kxSerializer_Read32uArray_(S, D, C) ///< Macro version of kSerializer_Read32uArray.
928
929 #define kSerializer_Write32s_(S, D) kxSerializer_Write32s_(S, D) ///< Macro version of kSerializer_Write32s.
930 #define kSerializer_Write32sArray_(S, D, C) kxSerializer_Write32sArray_(S, D, C) ///< Macro version of kSerializer_Write32sArray.
931 #define kSerializer_Read32s_(S, D) kxSerializer_Read32s_(S, D) ///< Macro version of kSerializer_Read32s.
932 #define kSerializer_Read32sArray_(S, D, C) kxSerializer_Read32sArray_(S, D, C) ///< Macro version of kSerializer_Read32sArray.
933
934 #define kSerializer_Write64u_(S, D) kxSerializer_Write64u_(S, D) ///< Macro version of kSerializer_Write64u.
935 #define kSerializer_Write64uArray_(S, D, C) kxSerializer_Write64uArray_(S, D, C) ///< Macro version of kSerializer_Write64uArray.
936 #define kSerializer_Read64u_(S, D) kxSerializer_Read64u_(S, D) ///< Macro version of kSerializer_Read64u.
937 #define kSerializer_Read64uArray_(S, D, C) kxSerializer_Read64uArray_(S, D, C) ///< Macro version of kSerializer_Read64uArray.
938
939 #define kSerializer_Write64s_(S, D) kxSerializer_Write64s_(S, D) ///< Macro version of kSerializer_Write64s.
940 #define kSerializer_Write64sArray_(S, D, C) kxSerializer_Write64sArray_(S, D, C) ///< Macro version of kSerializer_Write64sArray.
941 #define kSerializer_Read64s_(S, D) kxSerializer_Read64s_(S, D) ///< Macro version of kSerializer_Read64s.
942 #define kSerializer_Read64sArray_(S, D, C) kxSerializer_Read64sArray_(S, D, C) ///< Macro version of kSerializer_Read64sArray.
943
944 #define kSerializer_Write32f_(S, D) kxSerializer_Write32f_(S, D) ///< Macro version of kSerializer_Write32f.
945 #define kSerializer_Write32fArray_(S, D, C) kxSerializer_Write32fArray_(S, D, C) ///< Macro version of kSerializer_Write32fArray.
946 #define kSerializer_Read32f_(S, D) kxSerializer_Read32f_(S, D) ///< Macro version of kSerializer_Read32f.
947 #define kSerializer_Read32fArray_(S, D, C) kxSerializer_Read32fArray_(S, D, C) ///< Macro version of kSerializer_Read32fArray.
948
949 #define kSerializer_Write64f_(S, D) kxSerializer_Write64f_(S, D) ///< Macro version of kSerializer_Write64f.
950 #define kSerializer_Write64fArray_(S, D, C) kxSerializer_Write64fArray_(S, D, C) ///< Macro version of kSerializer_Write64fArray.
951 #define kSerializer_Read64f_(S, D) kxSerializer_Read64f_(S, D) ///< Macro version of kSerializer_Read64f.
952 #define kSerializer_Read64fArray_(S, D, C) kxSerializer_Read64fArray_(S, D, C) ///< Macro version of kSerializer_Read64fArray.
953
954 #define kSerializer_WriteSize_(S, D) kxSerializer_WriteSize_(S, D) ///< Macro version of kSerializer_WriteSize.
955 #define kSerializer_WriteSizeArray_(S, D, C) kxSerializer_WriteSizeArray_(S, D, C) ///< Macro version of kSerializer_WriteSizeArray.
956 #define kSerializer_ReadSize_(S, D) kxSerializer_ReadSize_(S, D) ///< Macro version of kSerializer_ReadSize.
957 #define kSerializer_ReadSizeArray_(S, D, C) kxSerializer_ReadSizeArray_(S, D, C) ///< Macro version of kSerializer_ReadSizeArray.
958
959 #define kSerializer_WriteSSize_(S, D) kxSerializer_WriteSSize_(S, D) ///< Macro version of kSerializer_WriteSSize.
960 #define kSerializer_WriteSSizeArray_(S, D, C) kxSerializer_WriteSSizeArray_(S, D, C) ///< Macro version of kSerializer_WriteSSizeArray.
961 #define kSerializer_ReadSSize_(S, D) kxSerializer_ReadSSize_(S, D) ///< Macro version of kSerializer_ReadSSize.
962 #define kSerializer_ReadSSizeArray_(S, D, C) kxSerializer_ReadSSizeArray_(S, D, C) ///< Macro version of kSerializer_ReadSSizeArray.
963
964 #define kSerializer_WriteType_(S, T, V) kxSerializer_WriteType_(S, T, V) ///< Macro version of kSerializer_WriteType.
965 #define kSerializer_ReadType_(S, T, V) kxSerializer_ReadType_(S, T, V) ///< Macro version of kSerializer_ReadType.
966
967 #define kSerializer_WriteItems_(S, T, V, I, C) kxSerializer_WriteItems_(S, T, V, I, C) ///< Macro version of kSerializer_WriteItems.
968 #define kSerializer_ReadItems_(S, T, V, I, C) kxSerializer_ReadItems_(S, T, V, I, C) ///< Macro version of kSerializer_ReadItems.
969
970 #define kSerializer_BeginWrite_(S, T, I) kxSerializer_BeginWrite_(S, T, I) ///< Macro version of kSerializer_BeginWrite.
971 #define kSerializer_EndWrite_(S) kxSerializer_EndWrite_(S) ///< Macro version of kSerializer_EndWrite.
972 #define kSerializer_BeginRead_(S, T, I) kxSerializer_BeginRead_(S, T, I) ///< Macro version of kSerializer_BeginRead.
973 #define kSerializer_EndRead_(S) kxSerializer_EndRead_(S) ///< Macro version of kSerializer_EndRead.
974 #define kSerializer_ReadCompleted_(S) kxSerializer_ReadCompleted_(S) ///< Macro version of kSerializer_ReadCompleted.
975
976 #define kSerializer_AdvanceRead_(S, O) kxSerializer_AdvanceRead_(S, O) ///< Macro version of kSerializer_AdvanceRead.
977 #define kSerializer_Flush_(S) kxSerializer_Flush_(S) ///< Macro version of kSerializer_Flush.
978 #define kSerializer_Reset_(S) kxSerializer_Reset_(S) ///< Macro version of kSerializer_Reset.
979 #define kSerializer_Stream_(S) kxSerializer_Stream_(S) ///< Macro version of kSerializer_Stream.
980
981 kEndHeader()
982
983 #include <kApi/Io/kSerializer.x.h>
984
985 #endif
k32u
Represents a 32-bit unsigned integer.
kSerializer::kSerializer_WriteText
kStatus kSerializer_WriteText(kSerializer serializer, const kChar *data)
Writes a null-terminated kChar array.
kSerializer::kSerializer_WriteType
kStatus kSerializer_WriteType(kSerializer serializer, kType type, kTypeVersion *version)
Writes a type code.
kSerializer::kSerializer_WriteSSize
kStatus kSerializer_WriteSSize(kSerializer serializer, kSSize data)
Writes a kSSize value.
kSerializer::kSerializer_SaveObject
kStatus kSerializer_SaveObject(kObject object, kType serializerType, const kChar *filePath)
Saves an object to file using the specified serializer type.
kSerializer::kSerializer_Read32u
kStatus kSerializer_Read32u(kSerializer serializer, k32u *data)
Reads a k32u value.
kSerializer::kSerializer_Construct
kStatus kSerializer_Construct(kSerializer *serializer, kStream stream, kType serializerType, kAlloc allocator)
Constructs a serializer object using the specified serialization format.
kSerializer::kSerializer_ReadSize
kStatus kSerializer_ReadSize(kSerializer serializer, kSize *data)
Reads a kSize value.
kSerializer::kSerializer_ReadText
kStatus kSerializer_ReadText(kSerializer serializer, kChar *data, kSize capacity)
Reads a null-terminated kChar array.
k64u
Represents a 64-bit unsigned integer.
kSerializer::kSerializer_Read32fArray
kStatus kSerializer_Read32fArray(kSerializer serializer, k32f *data, kSize count)
Reads a k32f array.
kSerializer::kSerializer_BeginWrite
kStatus kSerializer_BeginWrite(kSerializer serializer, kType sizeType, kBool includeSize)
Begins writing a measured section of data, using an 8, 16, 32, or 64-bit integer to record the size...
kAssembly
Represents a library of types.
kSerializer::kSerializer_ReadSSize
kStatus kSerializer_ReadSSize(kSerializer serializer, kSSize *data)
Reads a kSSize value.
kSerializer::kSerializer_SetVersion
kStatus kSerializer_SetVersion(kSerializer serializer, kAssembly assembly, kVersion version)
Sets the version to use when serializing types.
kSerializer::kSerializer_WriteSize
kStatus kSerializer_WriteSize(kSerializer serializer, kSize data)
Writes a kSize value.
kSerializer::kSerializer_WriteByteArray
kStatus kSerializer_WriteByteArray(kSerializer serializer, const kByte *data, kSize count)
Writes a kByte array.
kSerializer::kSerializer_Write16u
kStatus kSerializer_Write16u(kSerializer serializer, k16u data)
Writes a k16u value.
kSerializer::kSerializer_Write32uArray
kStatus kSerializer_Write32uArray(kSerializer serializer, const k32u *data, kSize count)
Writes a k32u array.
k16u
Represents a 16-bit unsigned integer.
kSerializer::kSerializer_Read8s
kStatus kSerializer_Read8s(kSerializer serializer, k8s *data)
Reads a k8s value.
kSize
Represents an unsigned integer that can store a pointer address.
kAlloc
Abstract base class for memory allocator types.
kSerializer::kSerializer_WriteItems
kStatus kSerializer_WriteItems(kSerializer serializer, kType type, kTypeVersion version, const void *items, kSize count)
Writes an array of values or objects.
k8u
Represents an 8-bit unsigned integer.
kSerializer::kSerializer_AdvanceRead
kStatus kSerializer_AdvanceRead(kSerializer serializer, kSize offset)
Reads and discards a specified number of bytes.
kSerializer::kSerializer_WriteSizeArray
kStatus kSerializer_WriteSizeArray(kSerializer serializer, const kSize *data, kSize count)
Writes a kSize array.
kSerializer::kSerializer_ReadByteArray
kStatus kSerializer_ReadByteArray(kSerializer serializer, kByte *data, kSize count)
Reads a kByte array.
kSerializer::kSerializer_Read8u
kStatus kSerializer_Read8u(kSerializer serializer, k8u *data)
Reads a k8u value.
kSerializer::kSerializer_Write64fArray
kStatus kSerializer_Write64fArray(kSerializer serializer, const k64f *data, kSize count)
Writes a k64f array.
kChar
Represents a single unit (byte) in a UTF-8 character.
kByte
Represents a byte on the current platform.
kSerializer::kSerializer_Read64s
kStatus kSerializer_Read64s(kSerializer serializer, k64s *data)
Reads a k64s value.
kSerializer::kSerializer_Write8uArray
kStatus kSerializer_Write8uArray(kSerializer serializer, const k8u *data, kSize count)
Writes a k8u array.
kSSize
Represents a signed integer that can store a pointer address.
kSerializer::kSerializer_Read16u
kStatus kSerializer_Read16u(kSerializer serializer, k16u *data)
Reads a k16u value.
kSerializer::kSerializer_Write32sArray
kStatus kSerializer_Write32sArray(kSerializer serializer, const k32s *data, kSize count)
Writes a k32s array.
kSerializer
Base class for serialization/deserialization classes.
kSerializer::kSerializer_Write32u
kStatus kSerializer_Write32u(kSerializer serializer, k32u data)
Writes a k32u value.
kSerializer::kSerializer_Write8u
kStatus kSerializer_Write8u(kSerializer serializer, k8u data)
Writes a k8u value.
kSerializer::kSerializer_Write32f
kStatus kSerializer_Write32f(kSerializer serializer, k32f data)
Writes a k32f value.
kSerializer::kSerializer_ReadSSizeArray
kStatus kSerializer_ReadSSizeArray(kSerializer serializer, kSSize *data, kSize count)
Reads a kSSize array.
kSerializer::kSerializer_Read16uArray
kStatus kSerializer_Read16uArray(kSerializer serializer, k16u *data, kSize count)
Reads a k16u array.
kSerializer::kSerializer_ReadSizeArray
kStatus kSerializer_ReadSizeArray(kSerializer serializer, kSize *data, kSize count)
Reads a kSize array.
kSerializer::kSerializer_WriteByte
kStatus kSerializer_WriteByte(kSerializer serializer, kByte data)
Writes a kByte value.
kSerializer::kSerializer_ReadChar
kStatus kSerializer_ReadChar(kSerializer serializer, kChar *data)
Reads a kChar value.
kTypeVersion
Represents an opaque reference to type version information (used in object serialization).
kSerializer::kSerializer_EndWrite
kStatus kSerializer_EndWrite(kSerializer serializer)
Ends writing a measured data section.
kSerializer::kSerializer_Read16s
kStatus kSerializer_Read16s(kSerializer serializer, k16s *data)
Reads a k16s value.
kSerializer::kSerializer_Write64f
kStatus kSerializer_Write64f(kSerializer serializer, k64f data)
Writes a k64f value.
kSerializer::kSerializer_Write8sArray
kStatus kSerializer_Write8sArray(kSerializer serializer, const k8s *data, kSize count)
Writes a k8s array.
kSerializer::kSerializer_WriteCharArray
kStatus kSerializer_WriteCharArray(kSerializer serializer, const kChar *data, kSize count)
Writes a kChar array.
kSerializer::kSerializer_Read16sArray
kStatus kSerializer_Read16sArray(kSerializer serializer, k16s *data, kSize count)
Reads a k16s array.
kSerializer::kSerializer_BeginRead
kStatus kSerializer_BeginRead(kSerializer serializer, kType sizeType, kBool includeSize)
Begins reading a measured data section.
kSerializer::kSerializer_ReadCharArray
kStatus kSerializer_ReadCharArray(kSerializer serializer, kChar *data, kSize count)
Reads a kChar array.
kSerializer::kSerializer_EndRead
kStatus kSerializer_EndRead(kSerializer serializer)
Ends reading a measured data section.
kApiDef.h
Essential API declarations.
kSerializer::kSerializer_Write64sArray
kStatus kSerializer_Write64sArray(kSerializer serializer, const k64s *data, kSize count)
Writes a k64s array.
kStream
Represents an I/O stream.
k32s
Represents a 32-bit signed integer.
kSerializer::kSerializer_Read32sArray
kStatus kSerializer_Read32sArray(kSerializer serializer, k32s *data, kSize count)
Reads a k32s array.
kSerializer::kSerializer_SetSizeEncoding
kStatus kSerializer_SetSizeEncoding(kSerializer serializer, k32u byteCount)
Explicitly sets the number of bytes used to encode/decode kSize and kSSize values.
kSerializer::kSerializer_ReadByte
kStatus kSerializer_ReadByte(kSerializer serializer, kByte *data)
Reads a kByte value.
kSerializer::kSerializer_Read64uArray
kStatus kSerializer_Read64uArray(kSerializer serializer, k64u *data, kSize count)
Reads a k64u array.
kSerializer::kSerializer_Write16s
kStatus kSerializer_Write16s(kSerializer serializer, k16s data)
Writes a k16s value.
k64s
Represents a 64-bit signed integer.
kSerializer::kSerializer_Write64s
kStatus kSerializer_Write64s(kSerializer serializer, k64s data)
Writes a k64s value.
kSerializer::kSerializer_Read8uArray
kStatus kSerializer_Read8uArray(kSerializer serializer, k8u *data, kSize count)
Reads a k8u array.
kSerializer::kSerializer_Write16sArray
kStatus kSerializer_Write16sArray(kSerializer serializer, const k16s *data, kSize count)
Writes a k16s array.
kSerializer::kSerializer_Read64sArray
kStatus kSerializer_Read64sArray(kSerializer serializer, k64s *data, kSize count)
Reads a k64s array.
k8s
Represents an 8-bit signed integer.
kSerializer::kSerializer_Write32s
kStatus kSerializer_Write32s(kSerializer serializer, k32s data)
Writes a k32s value.
kSerializer::kSerializer_Reset
kStatus kSerializer_Reset(kSerializer serializer)
Discards any streaming context accumulated by the serializer.
kSerializer::kSerializer_Write64u
kStatus kSerializer_Write64u(kSerializer serializer, k64u data)
Writes a k64u value.
kType
Represents metadata about a type (class, interface, or value).
kSerializer::kSerializer_ReadItems
kStatus kSerializer_ReadItems(kSerializer serializer, kType type, kTypeVersion version, void *items, kSize count)
Reads an array of values or objects.
kSerializer::kSerializer_Read64u
kStatus kSerializer_Read64u(kSerializer serializer, k64u *data)
Reads a k64u value.
kSerializer::kSerializer_Write32fArray
kStatus kSerializer_Write32fArray(kSerializer serializer, const k32f *data, kSize count)
Writes a k32f array.
k16s
Represents a 16-bit signed integer.
k32f
Represents a 32-bit floating-point number.
kObject
Root of all class types in the Zen type system.
kVersion
Represents a version number.
kSerializer::kSerializer_LoadObject
kStatus kSerializer_LoadObject(kObject *object, kType serializerType, const kChar *filePath, kAlloc readAlloc)
Loads an object from file using the specified serializer type.
kSerializer::kSerializer_Stream
kStream kSerializer_Stream(kSerializer serializer)
Gets the underlying stream.
kStatus
Represents an enumeration of error codes.
kSerializer::kSerializer_Read64f
kStatus kSerializer_Read64f(kSerializer serializer, k64f *data)
Reads a k64f value.
kSerializer::kSerializer_WriteObject
kStatus kSerializer_WriteObject(kSerializer serializer, kObject object)
Writes an object to the underlying stream.
kSerializer::kSerializer_Read64fArray
kStatus kSerializer_Read64fArray(kSerializer serializer, k64f *data, kSize count)
Reads a k64f array.
kSerializer::kSerializer_ReadType
kStatus kSerializer_ReadType(kSerializer serializer, kType *type, kTypeVersion *version)
Reads a type code.
kSerializer::kSerializer_Read32f
kStatus kSerializer_Read32f(kSerializer serializer, k32f *data)
Reads a k32f value.
k64f
Represents a 64-bit floating-point number.
kSerializer::kSerializer_Write8s
kStatus kSerializer_Write8s(kSerializer serializer, k8s data)
Writes a k8s value.
kSerializer::kSerializer_ReadCompleted
kBool kSerializer_ReadCompleted(kSerializer serializer)
Determines whether the current measured read section has more bytes.
kSerializer::kSerializer_WriteChar
kStatus kSerializer_WriteChar(kSerializer serializer, kChar data)
Writes a kChar value.
kSerializer::kSerializer_Flush
kStatus kSerializer_Flush(kSerializer serializer)
Flushes the serializer write buffer to the underlying stream.
kSerializer::kSerializer_Read32s
kStatus kSerializer_Read32s(kSerializer serializer, k32s *data)
Reads a k32s value.
kSerializer::kSerializer_ReadObject
kStatus kSerializer_ReadObject(kSerializer serializer, kObject *object, kAlloc allocator)
Reads an object from the underlying stream.
kBool
Represents a boolean value.
kSerializer::kSerializer_Write64uArray
kStatus kSerializer_Write64uArray(kSerializer serializer, const k64u *data, kSize count)
Writes a k64u array.
kSerializer::kSerializer_Read32uArray
kStatus kSerializer_Read32uArray(kSerializer serializer, k32u *data, kSize count)
Reads a k32u array.
kSerializer::kSerializer_Write16uArray
kStatus kSerializer_Write16uArray(kSerializer serializer, const k16u *data, kSize count)
Writes a k16u array.
kSerializer::kSerializer_Read8sArray
kStatus kSerializer_Read8sArray(kSerializer serializer, k8s *data, kSize count)
Reads a k8s array.
kSerializer::kSerializer_WriteSSizeArray
kStatus kSerializer_WriteSSizeArray(kSerializer serializer, const kSSize *data, kSize count)
Writes a kSSize array.