chadaustin / sajson

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

Null termination of input strings #21

Closed iboB closed 7 years ago

iboB commented 7 years ago

As discussed before here: https://github.com/chadaustin/sajson/issues/13

Currently the only way to get a string value is to risk an allocation (since it's gotten by std::string as_string()). With null termination there is a safe way to get it as const char* with no allocations needed

chadaustin commented 7 years ago

Thank you! I applied minor API tweaks to make it clear this is treating a JSON string as a nul-terminated C string.