Ecere Software
/
sdk
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fad741c
)
ecere/sys/JSON: Fixed support for writing struct properties
author
Jerome St-Louis
<jerome@ecere.com>
Mon, 16 Mar 2015 02:59:00 +0000
(22:59 -0400)
committer
Jerome St-Louis
<jerome@ecere.com>
Wed, 9 Dec 2015 23:11:25 +0000
(18:11 -0500)
ecere/src/sys/JSON.ec
patch
|
blob
|
history
diff --git
a/ecere/src/sys/JSON.ec
b/ecere/src/sys/JSON.ec
index
a6bebd7
..
31c2913
100644
(file)
--- a/
ecere/src/sys/JSON.ec
+++ b/
ecere/src/sys/JSON.ec
@@
-1009,6
+1009,11
@@
static bool _WriteJSONObject(File f, Class objectType, void * object, int indent
{
value.c = ((char (*)(void *))(void *)prop.Get)(object);
}
+ else if(type.type == structClass)
+ {
+ value.p = new byte[type.structSize];
+ ((void (*)(void *, void *))(void *)prop.Get)(object, value.p);
+ }
else
{
value.p = ((void *(*)(void *))(void *)prop.Get)(object);
@@
-1023,6
+1028,8
@@
static bool _WriteJSONObject(File f, Class objectType, void * object, int indent
f.Puts("\" : ");
WriteValue(f, type, value, indent);
isFirst = false;
+ if(type.type == structClass)
+ delete value.p;
}
}
}