netheril96 / StaticJSON

Fast, direct and static typed parsing of JSON with C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can I use staticjson for old autojsoncxx schema?

gggin opened this issue · comments

commented

I cannot find a script that generate autojsoncxx schema to staticjson

Sorry, I don't have time lately. If you are currently using autojsoncxx, you don't have to switch to staticjson. The major benefit of the latter is convenience.

commented

autojsoncxx's problem is code size! one schema means 10k in release file(windows platform)
I think staticjson's style maybe less.

Is a PR welcomed?

Yes, a PR is welcome. But don't expect the binary size increase to be significantly less. Or any less at all.

In the latest master branch, a directory autojsoncxx is created. It contains a script autojsoncxx.py that works like before, except that it generates a file compatible with StaticJSON. A header file autojsoncxx.hpp maps the new API to the old API.

There are some minor differences in how the two validate the input, but when the input is correct, the result should be the same.

The generated header file is bare. In other words, it includes no other files. You should include things like <string> and <vector> before including the generated header file.

commented

Thank you very much