Tencent / rapidjson

A fast JSON parser/generator for C++ with both SAX/DOM style API
http://rapidjson.org/
Other
14.17k stars 3.52k forks source link

Still no insitu parsing for non null-terminated strings? #2181

Open n00bmind opened 1 year ago

n00bmind commented 1 year ago

Hi. I've been trying to follow the conversation on adding a length limit to input streams to support parsing non null-terminated strings. I see there are a few issues and even pull requests (most of them several years old) discussing the concept, and I see some support for it was finally added to master for the Parse() interface. However.. nothing of the sort was ever done for ParseInSitu(), so the obvious question is why?

At my studio, we're mainly interested in doing insitu parsing for efficiency, so we really need support for this for cases where we cannot control the format of the input string. I could ofc modify the source code and put something together (the most straightforward solution would seem to be to do something like https://github.com/Tencent/rapidjson/pull/417/commits/58d72c7511026497f270c7d29c59dbfa5c31794d).

But the question remains.. why support this for read-only parsing but not in situ parsing? Is there anything I'm missing here?

n00bmind commented 1 year ago

Example of one of the conversations I found while looking for a solution to this.. https://github.com/Tencent/rapidjson/issues/158