void SkipEmpty()
{
- while(!f.Eof() && (!ch || ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t'))
+ while(!f.Eof() && (!ch || ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t' || ch == '/'))
{
f.Getc(&ch);
}
Property prop = null;
Class type = null;
bool isKey = false;
+ bool isTemplateArg = false;
uint offset = 0;
if(objectType)
{
prop = eClass_FindProperty(objectType, "key", objectType.module);
type = mapKeyClass;
+ isTemplateArg = true;
isKey = true;
}
else if(mapDataClass && !strcmp(string, "value"))
{
prop = eClass_FindProperty(objectType, "value", objectType.module);
type = mapDataClass;
+ isTemplateArg = true;
}
else
{
{
type = eSystem_FindClass(__thisModule, member.dataTypeString);
if(!type)
+ type = eSystem_FindClass(objectType.module, member.dataTypeString);
+ if(!type)
type = eSystem_FindClass(__thisModule.application, member.dataTypeString);
offset = member._class.offset + member.offset;
{
type = eSystem_FindClass(__thisModule, prop.dataTypeString);
if(!type)
+ type = eSystem_FindClass(objectType.module, prop.dataTypeString);
+ if(!type)
type = eSystem_FindClass(__thisModule.application, prop.dataTypeString);
}
else
}
else
{
- ((void (*)(void *, void *))(void *)prop.Set)(*object, value.p);
+ if(isTemplateArg)
+ ((void (*)(void *, uint64))(void *)prop.Set)(*object, (uint64)(uintptr)value.p);
+ else
+ ((void (*)(void *, void *))(void *)prop.Set)(*object, value.p);
}
}
}
else
result = syntaxError;
- if(prop && type.type == structClass)
+ if(prop && type && type.type == structClass)
{
delete value.p;
}
for(prop = type.conversions.first; prop; prop = prop.next)
{
bool refProp = false;
- Class c;
if(!strcmp(prop.name, type.base.fullName))
refProp = true;
- else if( (c = eSystem_FindClass(type.module, prop.name) ) )
+ else
{
- Property p;
- for(p = c.conversions.first; p; p = p.next)
+ Class c = eSystem_FindClass(type.module, prop.name);
+ if(!c)
+ c = eSystem_FindClass(type.module.application, prop.name);
+ if(c)
{
- if(!strcmp(p.name, type.base.fullName) && !p.Set && !p.Get)
+ Property p;
+ for(p = c.conversions.first; p; p = p.next)
{
- refProp = true;
- break;
+ if(!strcmp(p.name, type.base.fullName) && !p.Set && !p.Get)
+ {
+ refProp = true;
+ break;
+ }
}
}
}
{
Class dataType;
dataType = eSystem_FindClass(__thisModule, type.dataTypeString);
+ if(!dataType)
+ dataType = eSystem_FindClass(type.module, type.dataTypeString);
+ if(!dataType)
+ dataType = eSystem_FindClass(__thisModule.application, type.dataTypeString);
WriteNumber(f, dataType, value, indent);
}
else if(type.type == systemClass || type.type == unitClass)
if(!prop.conversion && (!prop.IsSet || prop.IsSet(object)))
{
DataValue value { };
+ bool isTemplateArg = false;
Class type;
if(mapKeyClass && !strcmp(prop.name, "key"))
+ {
+ isTemplateArg = true;
type = mapKeyClass;
+ }
else if(mapDataClass && !strcmp(prop.name, "value"))
+ {
+ isTemplateArg = true;
type = mapDataClass;
+ }
else
type = eSystem_FindClass(__thisModule, prop.dataTypeString);
+
+ if(!type)
+ type = eSystem_FindClass(objectType.module, prop.dataTypeString);
if(!type)
type = eSystem_FindClass(__thisModule.application, prop.dataTypeString);
if(!type)
PrintLn("warning: Unresolved data type ", (String)prop.dataTypeString);
else
{
- // 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"))
+ if(type.type == enumClass || type.type == bitClass || type.type == unitClass || type.type == systemClass)
{
- 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);
+ // 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)
{
}
else
{
- value.p = ((void *(*)(void *))(void *)prop.Get)(object);
+ 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");
uint offset;
Class type = eSystem_FindClass(__thisModule, member.dataTypeString);
if(!type)
+ type = eSystem_FindClass(objectType.module, member.dataTypeString);
+ if(!type)
type = eSystem_FindClass(__thisModule.application, member.dataTypeString);
offset = member._class.offset + member.offset;