--
You received this message because you are subscribed to the Google Groups "FlatBuffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flatbuffers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
void RecursiveReflection(const flatbuffers::Table* table, const reflection::Object* reflectionTable, const reflection::Schema* schema) { auto tableFields = reflectionTable->fields(); for (size_t i = 0; i < tableFields->Length(); i++) { if (tableFields->Get(i)->type()->base_type() == reflection::Obj) { flatbuffers::Table* t = flatbuffers::GetFieldT(*table, *tableFields->Get(i)); std::string typeName; // How to get the type name here const reflection::Object* refT = schema->objects()->LookupByKey(typeName); RecursiveReflection(t, refT, schema); } std::string fieldName = tableFields->Get(i)->name()->c_str(); auto fieldVal = flatbuffers::GetAnyFieldS(*table, *tableFields->Get(i), schema); } }
How can I get the name of the nested table type (not the field name but the type name). Reflection::Type doesn't seem to have the type name, it just has the field name field type (e.g. INT, FLOAT etc.)
void RecursiveReflection(const flatbuffers::Table* table, const reflection::Object* reflectionTable, const reflection::Schema* schema
) { if (table == nullptr) return; auto tableFields = reflectionTable->fields(); for (size_t i = 0; i < tableFields->Length(); i++) { if (tableFields->Get(i)->type()->base_type() == reflection::Obj) { flatbuffers::Table* t = flatbuffers::GetFieldT(*table, *tableFields->Get(i)); const reflection::Object* refT = schema->objects()->Get(tableFields->Get(i)->type()->index());