JSON_CUTIL (RPGLE)

JSON : Checker Utilities
Details ....

Copybooks  

'json_h.rpgle'
'json_int_h.rpgle'
'iconv_h.rpgle'
'ifsio_h.rpgle'
'libc_h.rpgle'
'ceeapi_h.rpgle'

Procedures  

json_validateexported
Validate JSON string
json_validateFileexported
Validate JSON file

Detailed Description  

Utility module for validating string for the JSON syntax. The strings are converted from the passed or Job ccsid to ASCII (ccsid 819). Comments before, inline and after the JSON string are not supported.
Author:
Mihael Schmidt
Date:
2009-02-28
Links:
http://www.json.org/JSON_checker/

Procedure Documentation  

json_validate  

Booleanjson_validate(Zeichen, Integer)
Validates the passed JSON string.
Parameter:
Zeichen (65535)   const   variable sizeJSON string
Numerisch (Integer) (10)   const   optionalCCSID from the source string (default: 0 = Job CCSID)
Return value:
Boolean*on = valid JSON string
*off = invalid JSON string
Exported.
Author:
Mihael Schmidt

json_validateFile  

Booleanjson_validateFile(Zeichen, Integer)
Validates the JSON string in the passed file. The file should only contain the JSON string. Comments are not supported.
Parameter:
Zeichen (65535)   const   variable sizeIFS file path
Numerisch (Integer) (10)   const   optionalCCSID from the source string (default: 0 = Job CCSID)
Return value:
Boolean*on = valid JSON string
*off = invalid JSON string
Exported.
Author:
Mihael Schmidt