struct Field
{
int ID;
- intrusive_ptr<Type> FType;
+ const char *TypeName;
const char *Name;
int Attributes;
- Field(int id, const intrusive_ptr<Type>& type, const char *name, int attributes)
- : ID(id), FType(type), Name(name), Attributes(attributes)
+ Field(int id, const char *type, const char *name, int attributes)
+ : ID(id), TypeName(type), Name(name), Attributes(attributes)
{ }
};
if (!(field.Attributes & FAConfig) || field.Attributes & FAInternal)
continue;
- if (field.FType != Type::GetByName("int") && field.FType != Type::GetByName("double")
- && field.FType != Type::GetByName("bool") && field.FType != Type::GetByName("String"))
+ if (strcmp(field.TypeName, "int") != 0 && strcmp(field.TypeName, "double") != 0
+ && strcmp(field.TypeName, "bool") != 0 && strcmp(field.TypeName, "String") != 0)
continue;
String fname = field.Name;
} else if (value.IsObjectType<Array>()) {
Array::Ptr arr = value;
return arr->Get(index);
- } else if (value.IsObjectType<Object>()) {
+ } else if (value.IsObject()) {
Object::Ptr object = value;
Type::Ptr type = object->GetReflectionType();
for (it = klass.Fields.begin(); it != klass.Fields.end(); it++) {
std::string ftype = it->Type;
- if (ftype.find("::Ptr") == ftype.size() - strlen("::Ptr"))
+ if (ftype.find("::Ptr") != std::string::npos)
ftype = ftype.substr(0, ftype.size() - strlen("::Ptr"));
if (it->Attributes & FAEnum)
ftype = "int";
std::cout << "\t\t\t" << "case " << num << ":" << std::endl
- << "\t\t\t\t" << "return Field(" << num << ", Type::GetByName(\"" << ftype << "\"), \"" << it->Name << "\", " << it->Attributes << ");" << std::endl;
+ << "\t\t\t\t" << "return Field(" << num << ", \"" << ftype << "\", \"" << it->Name << "\", " << it->Attributes << ");" << std::endl;
num++;
}