Wed, 10 Dec 2025 22:34:48 +0100
fix that the docu does not explain that you must reset a parser that ran into an error
| docs/Writerside/topics/json.h.md | file | annotate | diff | comparison | revisions | |
| src/cx/json.h | file | annotate | diff | comparison | revisions |
--- a/docs/Writerside/topics/json.h.md Wed Dec 10 22:16:19 2025 +0100 +++ b/docs/Writerside/topics/json.h.md Wed Dec 10 22:34:48 2025 +0100 @@ -55,7 +55,8 @@ A complete list of all status codes can be seen [below](#list-of-status-codes). -If you want to reuse a `CxJson` structure, you can call `cxJsonReset()`, even if the last operation was a failure. +If you want to reuse a `CxJson` structure, you can call `cxJsonReset()`. +In particular, you _must_ reset the parser when the last operation was a failure. Otherwise, you need to call `cxJsonDestroy()` when you are done with the parser. The function `cxJsonFromString()` combines the above procedure.
--- a/src/cx/json.h Wed Dec 10 22:16:19 2025 +0100 +++ b/src/cx/json.h Wed Dec 10 22:34:48 2025 +0100 @@ -495,8 +495,8 @@ /** * Destroys and re-initializes the JSON interface. * - * You might want to use this to reset the parser after - * encountering a syntax error. + * You must use this to reset the parser after encountering a syntax error + * if you want to continue using it. * * @param json the JSON interface */