A little treat for everyone, now with working decoding
https://raw.github.com/nikkiii/logup...clude/json.inc (Previous paste.ee link had a bug with string lengths, this implementation will be fixed a lot more often if broken)
Testing:
http://paste.ee/r/yqhgL
Results:
Code:
L 03/18/2013 - 01:38:30: [testjson.smx] Trying to decode: {"integer": 1, "string": "Hello World", "integer2": 2}
L 03/18/2013 - 01:38:30: [testjson.smx] --> Passed
L 03/18/2013 - 01:38:30: [testjson.smx] Trying to decode: {"string": "Hello World"}
L 03/18/2013 - 01:38:30: [testjson.smx] --> Passed
L 03/18/2013 - 01:38:30: [testjson.smx] Trying to decode: {"bool": true}
L 03/18/2013 - 01:38:30: [testjson.smx] --> Passed
L 03/18/2013 - 01:38:30: [testjson.smx] Trying to decode: {"null": null}
L 03/18/2013 - 01:38:30: [testjson.smx] --> Failed
L 03/18/2013 - 01:38:30: [testjson.smx] Running self tests on data...
L 03/18/2013 - 01:38:30: [testjson.smx] --> String: Passed
L 03/18/2013 - 01:38:30: [testjson.smx] --> Boolean: Passed
L 03/18/2013 - 01:38:30: [testjson.smx] --> Integer: Passed
L 03/18/2013 - 01:38:30: [testjson.smx] --> Data tests Passed
'null' was not implemented in the original parser, so I didn't change a thing about that. The important part is that it decodes at least basic JSON just fine.
__________________