NEW IN THIS RELEASE:
- nfJsonRead performs JSON validation: invalid Json throws error indicating reason.
- nfJsonPerfTest: proper error management enabled for invalid Json input from clipboard
- nfJsonToCursor: use of strict date format
Functions & Usage:
( Each function is a single prg - No additional dependencies / Requires VFP9 )- oJson = nfJsonRead(cJsonString , isFileName,lReviveCollections)
- cJsonString = nfJsonCreate(oVfp, lFormattedOutput, lNoNullArrayItems,cRootName)
- nfJsonToCursor(cJson, cCursorName , lForceImportFromArray) ( creates cursor back from Json created using nfCursorToJson4vfp )
- nfCursorToJson4vfp()&& converts current open table/cursor to Json suitable for later use of nfJsonToCursor()
- nfCursorToJson(lReturnArray, lArrayofValues, lIncludestruct, lFormattedOutput)&& converts current open table/cursor to Json
- nfCursorToObject(lCopyToArray, lIncludeStruct)
Tests & Sample files:
- nfJsonPerfTest.prg: just run it and choose one of the embedded json samples from the list to check performance on your pc. ( Allows you to parse Json from clipboard too. )
- examples.prg will parse the next Json files included in JsonSamples folder. just run from test folder and see sample code and output.
- collectionTest.prg: creates a complex collection , converts it to Json and back to vfp.
- Sample Json files included:
- youtubesearch.json
- cycloneForecast.json
- dropbox.json
- googleMapsDistance.json
- iphone photo.json
- mapquest.json
- mySimpleArray.json
- tweeter.json
- weatherService.json
- yahooweather.json