Jsonifier allows you to optimize parsing speed if you know that the data will be minified, here is how:
- When parsing the JSON, you can set the
minified
member of theparse_options
structure, which gets passed as the first or second template argument ofparseJson
to true.
Here's a complete example of parsing JSON data with minified optimization enabled:
#include <jsonifier/Index.hpp>
#include <iostream>
int32_t main() {
jsonifier::string buffer{ your_json_string };
obj_t obj;
jsonifier::jsonifier_core jsonifier;
jsonifier.parseJson<jsonifier::parse_options{ .minified = true }>(obj, buffer);
// Process the parsed data in 'obj' here.
return 0;
}
Jsonifier makes parsing JSON in C++ easy and provides a convenient way to optimize when parsing minified json data. Refer to the official documentation for more details and advanced usage.
Feel free to explore Jsonifier and incorporate it into your projects for efficient JSON parsing and serialization.
Happy coding!