You are not logged in.
I try to play with custom serialization of record as array of unnamed values.
If I correctly understand, for this purpose it is necessary to use RecordSaveJson.
The result, for example, is [365,-365,36.5,"2014-02-25T23:18:38","day\/3"]
For a unserialization I use RecordLoadJson. The result is expected.
The problem consists that it isn't clear how to check correctness of the received result.
Offline
I decided to use the simplified check on the basis of a trick with NULCHAR as in SynCommons.
The project below contains different variants of work with JSON.
Offline
Sadly, the link just does not work...
"Страница не найдена", it says...
"Page not found", Google translates...
By the way, did you check the latest updates about UTF-8 in SynCommons.pas?
It now handles UTF-16 surrogates as expected, and also introduces some nice validation patterns within the process.
A good step forward, still using your speed enhancements patterns for ASCII 7-bit process.
See http://synopse.info/forum/viewtopic.php?pid=6597#p6597
Offline
Sorry.
Here some serialization examples http://guildalfa.ru/alsha/sites/default … Proj_0.zip
and here annotation (in Russian) http://guildalfa.ru/alsha/node/28
Thanks for the link. Very interesting. I will close read it and check UTF-updates in week.
Offline
Great post.
But, in fact, most of the dynamic array JSON serialization was already implemented within SynCommons.
Perhaps some kind of dynamic arrays (with smallint?) are not handled yet... but is it worth it?
I suspect there is no need to add a separate registration process, here.
I've added TTextWriter.AddDynArrayJSON() overloaded method and new function DynArrayLoadJSON() to be used e.g. for custom record JSON serialization, within TDynArrayJSONCustomReader/TDynArrayJSONCustomWriter callbacks.
They are just convenient functions to serialize/unserialize to/from JSON any dynamic array value, directly within the custom record serialization.
See http://synopse.info/fossil/info/beda33419e
Offline
In my source code I didn't use the predetermined types to show possibility of switching of data presentation.
Post is changed according to SynCommons changes.
For the best translation from/to Russian you can use http://www.online-translator.com/Default.aspx/Text
Offline
Thank you Sha, your source code help me a lot when dealing with JSON with SynCommons and friends
Offline