www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Serialization array of structure

reply "Suliman" <evermind live.ru> writes:
Look like I am doing serialization wrong way:

struct DBFields
{
Date date;
string tag;
int popularity;
}

DBFields [] dbfields;
DBFields dbfield;
.....
dbfields ~= dbfield;
writeln(serializeToJson(dbfields));

As result I am getting only first string.
[{"popularity":1,"tag":"webserver","date":"2008-08-21"}]

But dbfields should include not only one string, but much more.

What I am doing wrong?
Jun 13 2015
parent "Suliman" <evermind live.ru> writes:
Oh, sorry, the error was in another place.
Jun 13 2015