-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to load YAML map into hash table #66
Comments
I've been thinking about this. It kind of goes against the core principal of the library, which is that it simply slots data into client-defined data structures. I was assuming that anything that required loading data who's structure wasn't known up-front would be done better by using libyaml directly. On the other hand, I've considered a CYAML_CUSTOM value type, which would need a callback function, and the client would get to handle the libyaml events. However, I don't like exposing a libyaml API requirement through libcyaml's API. Anyway, thanks for the feedback/request. I need to think about it some more! |
The problem is then that libcyaml becomes useless if I want to use it for the majority of my use cases but I have this one bit of yaml that requires that I parse it into a hash table. I think the CYAML_CUSTOM value would be very useful and offers that escape hatch. Usage of libcyaml requires linking in libyaml anyway so there's no shame in exposing some libyaml APIs or data structures via libcyaml, unless you were planning on uprooting your implementation to use some other low-level yaml parsing library. |
@tlsa Is it now supported to load YAML map into hash table ? |
@XisonChen No, it's not currently supported. |
It seems this library is limited to loading only structured maps into specific C structs with known (static) keys and types. It would be useful to allow a map with unknown (dynamic) keys to be loaded into a runtime hash table data structure. Or at the very least provide an example of how to escape the
libcyaml
binding mechanism and be able to work at thelibyaml
level for a specific schema.The text was updated successfully, but these errors were encountered: