JSON PrettyPrint

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
nblackburn
User
User
Posts: 67
Joined: Mon Aug 19, 2013 1:22 am
Location: United Kingdom
Contact:

JSON PrettyPrint

Post by nblackburn »

Hello,

Great work on the JSON library but feel it could benefit from a few more features as it very much is cumbersome to work with without knowing the structure of the document. One of my suggestions would be to allow for more options to be passed to the pretty print function via the use of a new function named...

Code: Select all

SetJSONOutput(#PB_JSON_INDENTLEVEL, 4) ; set's the indent level to be used on the output.
SetJSONOutput(#PB_JSON_PRESERVE_STRUCTURE, #True) ; keeps the order of the structure intact.
which would allow more control over the appearance of the pretty printed JSON to make it more readable and keeping the developer in control of his/her program instead of taking it away.

Kind Regards,
Nathaniel Blackburn
Image