You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm considering adopting the YAML format as the serialization format in my apps, and I've been searching for all the C/C++ YAML libraries available, but... to my surprise, all of them assume your program knows -or decides- the "schema" (data types, data structures, etc.)
However, I want that the "schema" and the data types and structures are owned by the YAML file, and not by the program (of course I agree programs are written with some certain data structures, but I want them to be able to read the YAML file and then later check if the YAML schema matches the program structures or not).
In other words, I was hoping to find a YAML library that handled the data types for you, so that you would tell it data=load("thisfile.yaml"); and then the library could tell you something like "data contains 3 objects of structure car and 2 objects of structure bike. Structure car has fields for brand (string), model (string), price (float), available (boolean)... etc".
Can this be done with your library? Do you have any example/demo that does this?
Thanks a lot!
The text was updated successfully, but these errors were encountered:
BTW, as a related question, can class inheritance be written in some way into a YAML file? I mean, is it possible to create a YAML file where structures triangle, quad, and line are derived from shape, and therefore all of them share exactly the same fields for their common shape base class? Would your YAML parser be able to detect that triangle, quad, and line have a common part (their shape "base class") ?
Nevermind, after writing this I realized that actually what I need is not YAML, but my own serialization format. Many formats exist, but none of them offer the kind of OOP awareness that I need.
Hi!
I'm considering adopting the YAML format as the serialization format in my apps, and I've been searching for all the C/C++ YAML libraries available, but... to my surprise, all of them assume your program knows -or decides- the "schema" (data types, data structures, etc.)
However, I want that the "schema" and the data types and structures are owned by the YAML file, and not by the program (of course I agree programs are written with some certain data structures, but I want them to be able to read the YAML file and then later check if the YAML schema matches the program structures or not).
In other words, I was hoping to find a YAML library that handled the data types for you, so that you would tell it
data=load("thisfile.yaml");
and then the library could tell you something like "data
contains 3 objects of structurecar
and 2 objects of structurebike
. Structurecar
has fields forbrand
(string),model
(string),price
(float),available
(boolean)... etc".Can this be done with your library? Do you have any example/demo that does this?
Thanks a lot!
The text was updated successfully, but these errors were encountered: