On 21/07/2011 08:57, Tobias Pankrath wrote:
Hi everyone,
I'm taking a look at D again and asked myself, if
it is possible to write a template mixin or something
similiar that automatically serializes an object to json.
For example:
class MyClass
{
string memberA;
int memberB;
On 21/07/2011 08:57, Tobias Pankrath wrote:
Hi everyone,
I'm taking a look at D again and asked myself, if
it is possible to write a template mixin or something
similiar that automatically serializes an object to json.
For example:
class MyClass
{
string memberA;
int memberB;
On 2011-07-21 09:57, Tobias Pankrath wrote:
Hi everyone,
I'm taking a look at D again and asked myself, if
it is possible to write a template mixin or something
similiar that automatically serializes an object to json.
For example:
class MyClass
{
string memberA;
int memberB;
Have a look at Orange: http://www.dsource.org/projects/orange
I'm in a middle of a complete rewrite but you can use a previous version
(if it still works) or look at the code.
Thank you for pointing me there. Looks very interesting. I took a quick look
at the code and got some questions. I
For another implementation, find the functions toJson and toJsonValue
in my web.d
http://arsdnet.net/dcode/web.d
Bascially: foreach(member; item.tupleof) {
static if(is(typeof(member) == something)
json it
else static if repeat for supported type families
}
On 2011-07-21 13:09, Tobias Pankrath wrote:
Have a look at Orange: http://www.dsource.org/projects/orange
I'm in a middle of a complete rewrite but you can use a previous version
(if it still works) or look at the code.
Thank you for pointing me there. Looks very interesting. I took a quick