Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This routine is only for situations where you will be building a json string in order. In fact, SRP_JsonX and SRP_JsonX_End are the only other routines you can use with this kind of document. Each call to SRP_JsonX behaves exactly the same as it always does, but instead of creating json structures in memory, each call appends json text to a string buffer. This is why you must specify the formatting via the IsPretty parameter at the beginning since formatting will be done with each call to SRP_JsonX. When you end the document by calling SRP_JsonX_End, the FormatOptions parameter will be ignored, and the json you built will be returned. If you know you are building json in order, this will be faster than using SRP_JsonX_Begin.

The Name parameter can be anything you want as it is only used for debugging purposes. The name will appear when calling SRP_JsonX_State or SRP_JsonX_Trace.

Note: The IsPretty parameter is just a boolean. Setting it to 1 makes the output pretty, and setting it to 0 makes it concise. If you include the SRPJSONX insert in your code, you may also use JsonxPretty$ or JsonxConcise$ for more code readability.

...