Bwar / CJsonObject

Ultralightweight JSON parser in C++ based on cJSON
MIT License
648 stars 239 forks source link

please add tag before version with sstream #28

Closed JojoS62 closed 4 years ago

JojoS62 commented 4 years ago

could you please add a release tag before the version that uses sstream? That version looks usable with microcontrollers, but adding sstream is pulling in too much stuff from c++ streams including exceptions, and that is increasing program size too much.

Bwar commented 4 years ago

ok, my negligence.

JojoS62 commented 4 years ago

thanks for your fast replay. And no, its ok, it depends on which systems your library is used. I have compiled the master branch now for a STM32F4 device with gcc and it uses about 30 kB in my debug build. The std::ostringstream is used only in the () operator. When this is not used, then the linker will not include the stream stuff. When I call the operator(), it adds 170 kB :) But using the osstream just for converting the int to string is a very expensive function.

I have compiled the version 1.2 also, but there is a bracket mismatch in https://github.com/Bwar/CJsonObject/blob/28faaadacbf0cbda1c6eb295104b241e02c085af/CJsonObject.cpp#L2191 and https://github.com/Bwar/CJsonObject/blob/28faaadacbf0cbda1c6eb295104b241e02c085af/CJsonObject.cpp#L2253

Bwar commented 4 years ago

Thanks for your issue. sstream had been removed from master and v1.4.