A minimalistic human-readable serialisation format parser for an embedded system

天涯浪子 提交于 2019-12-20 12:35:09

问题


By "human-readable serialisation format" I mean YAML, JSON, INI or like. Please note, XML is too verbose and too inconvenient for my purposes, so let's leave it alone as the last resort.

The format should store the data as "named key -- value" pairs and allow for nesting and arrays. Absence of arrays is not critical, though. Also, type-awareness (ability to return data not only as plain strings) is highly appreciated.

What I need exactly is a pure C library, which provides an API for parsing data (encoding is optional and of lesser importance). It must fit into somewhat about 16-20 KiB, when compiled for ARM7.

I've googled and wikied around, but couldn't find an artifact satisfying all the above requirements.


回答1:


I found Jansson a while back and it might fit your requirements.




回答2:


http://igagis.github.io/stob/ might be a good option as it is very simple. Although there is no plain C library, there is C++ library.



来源:https://stackoverflow.com/questions/7488112/a-minimalistic-human-readable-serialisation-format-parser-for-an-embedded-system

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!