- value.p = *(void **)((byte *)object + member._class.offset + member.offset);
- if(!value.p)
- continue;
- }
- else if(type == class(double) || !strcmp(type.dataTypeString, "double"))
- {
- value.d = *(double *)((byte *)object + member._class.offset + member.offset);
- }
- else if(type == class(float) || !strcmp(type.dataTypeString, "float"))
- {
- value.f = *(float *)((byte *)object + member._class.offset + member.offset);
- }
- else if(type.typeSize == sizeof(int64) || !strcmp(type.dataTypeString, "int64")
- !strcmp(type.dataTypeString, "unsigned int64") || !strcmp(type.dataTypeString, "uint64"))
- {
- value.ui64 = *(uint64 *)((byte *)object + member._class.offset + member.offset);
+ {
+ if(type.type == enumClass || type.type == bitClass || type.type == unitClass || type.type == systemClass)
+ {
+ // TOFIX: How to swiftly handle classes with base data type?
+ if(type == class(double) || !strcmp(type.dataTypeString, "double"))
+ {
+ value.d = ((double (*)(void *))(void *)prop.Get)(object);
+ }
+ else if(type == class(float) || !strcmp(type.dataTypeString, "float"))
+ {
+ value.f = ((float (*)(void *))(void *)prop.Get)(object);
+ }
+ else if(type.typeSize == sizeof(int64) || !strcmp(type.dataTypeString, "int64") ||
+ !strcmp(type.dataTypeString, "unsigned int64") || !strcmp(type.dataTypeString, "uint64"))
+ {
+ value.ui64 = ((uint64 (*)(void *))(void *)prop.Get)(object);
+ }
+ else if(type.typeSize == sizeof(int) || !strcmp(type.dataTypeString, "int") ||
+ !strcmp(type.dataTypeString, "unsigned int") || !strcmp(type.dataTypeString, "uint"))
+ {
+ value.i = ((int (*)(void *))(void *)prop.Get)(object);
+ }
+ else if(type.typeSize == sizeof(short int) || !strcmp(type.dataTypeString, "short") ||
+ !strcmp(type.dataTypeString, "unsigned short") || !strcmp(type.dataTypeString, "uint16") ||
+ !strcmp(type.dataTypeString, "int16"))
+ {
+ value.s = ((short (*)(void *))(void *)prop.Get)(object);
+ }
+ else if(type.typeSize == sizeof(byte) || !strcmp(type.dataTypeString, "char") ||
+ !strcmp(type.dataTypeString, "unsigned char") || !strcmp(type.dataTypeString, "byte"))
+ {
+ value.c = ((char (*)(void *))(void *)prop.Get)(object);
+ }
+ }
+ else if(type.type == structClass)
+ {
+ value.p = new0 byte[type.structSize];
+ ((void (*)(void *, void *))(void *)prop.Get)(object, value.p);
+ }
+ else
+ {
+ if(isTemplateArg)
+ value.p = (void *)(uintptr)((uint64 (*)(void *))(void *)prop.Get)(object);
+ else
+ value.p = ((void *(*)(void *))(void *)prop.Get)(object);
+ }
+
+ if(!isFirst) f.Puts(",\n");
+ for(c = 0; c<indent; c++) f.Puts(" ");
+
+ if(!eCON)
+ {
+ f.Puts("\"");
+ f.Putc((char)toupper(prop.name[0]));
+ f.Puts(prop.name+1);
+ f.Puts("\" : ");
+ }
+ else if(!omitDefaultIdentifier)
+ {
+ f.Puts(prop.name);
+ f.Puts(" = ");
+ }
+ WriteValue(f, type, value, indent, eCON);
+ isFirst = false;
+ if(type.type == structClass)
+ delete value.p;
+ }