chadaustin / sajson

Lightweight, extremely high-performance JSON parser for C++11
MIT License
568 stars 43 forks source link

preserving key order in objects #35

Closed wojdyr closed 7 years ago

wojdyr commented 7 years ago

This may be a non-goal for sajson, but I wanted to preserve the order of keys, so I can write everything back to a file minimizing differences with the original file. As a quick hack I added a couple of #ifdefs to disable key sorting and to remove affected functions: https://github.com/project-gemmi/gemmi/commit/8668beeb012d6e2232e0cd39cf6434a06ed78b9c

Not sure if it's worth upstreaming, but just to let you know.

chadaustin commented 7 years ago

I think this would be fine to upstream, though I'd probably be explicit and name it SAJSON_UNSORTED_OBJECT_KEYS