forked from BigfootDev/flatbuffers
[C++] support native_inline attribute for vector of tables (#7479)
This commit is contained in:
@@ -464,6 +464,10 @@ inline bool IsStruct(const Type &type) {
|
||||
return type.base_type == BASE_TYPE_STRUCT && type.struct_def->fixed;
|
||||
}
|
||||
|
||||
inline bool IsTable(const Type &type) {
|
||||
return type.base_type == BASE_TYPE_STRUCT && !type.struct_def->fixed;
|
||||
}
|
||||
|
||||
inline bool IsUnion(const Type &type) {
|
||||
return type.enum_def != nullptr && type.enum_def->is_union;
|
||||
}
|
||||
@@ -476,6 +480,14 @@ inline bool IsVector(const Type &type) {
|
||||
return type.base_type == BASE_TYPE_VECTOR;
|
||||
}
|
||||
|
||||
inline bool IsVectorOfStruct(const Type& type) {
|
||||
return IsVector(type) && IsStruct(type.VectorType());
|
||||
}
|
||||
|
||||
inline bool IsVectorOfTable(const Type& type) {
|
||||
return IsVector(type) && IsTable(type.VectorType());
|
||||
}
|
||||
|
||||
inline bool IsArray(const Type &type) {
|
||||
return type.base_type == BASE_TYPE_ARRAY;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user