3 ms·
jsmn is a nice JSON tokenizer. You malloc a chunk of memory up front, but that's it. It gives you pointers to the tokens and you can do what you like with them.
by pjungwir 12y ago
jsmn is a nice JSON tokenizer. You malloc a chunk of memory up front, but that's it. It gives you pointers to the tokens and you can do what you like with them. I am using it in an app that has a fixed-size data structure that is populated from a JSON file. So my code is malloc-free also.
- aktau 12y agoLink for those interested: https://bitbucket.org/zserge/jsmn/wiki/Home https://bitbucket.org/zserge/jsmn/wiki/Home jsmn is pretty awesome, and contrary to this (std::string, std::vector) actually puts you in charge of allocations. It's also in C. In a similar vein, and also possibly already mentioned: - yayl (C): https://lloyd.github.io/yajl/ https://lloyd.github.io/yajl/ - microjson (C): http://esr.ibiblio.org/?p=6262 http://esr.ibiblio.org/?p=6262