mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-04 12:43:24 +00:00
Mass Refactoring to use IsString and other BASE_TYPE helpers (#6193)
* Updated SupportsAdvancedUnionFeatures to look out for string * Mass refactoring to use BASE_TYPE helper functions. Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
@@ -401,7 +401,7 @@ class PhpGenerator : public BaseGenerator {
|
||||
code += Indent + Indent + "$o = $this->__offset(" +
|
||||
NumToString(field.value.offset) + ");\n";
|
||||
|
||||
if (field.value.type.VectorType().base_type == BASE_TYPE_STRING) {
|
||||
if (IsString(field.value.type.VectorType())) {
|
||||
code += Indent + Indent;
|
||||
code += "return $o != 0 ? $this->__string($this->__vector($o) + $j * ";
|
||||
code += NumToString(InlineSize(vectortype)) + ") : ";
|
||||
@@ -705,7 +705,7 @@ class PhpGenerator : public BaseGenerator {
|
||||
default: FLATBUFFERS_ASSERT(0);
|
||||
}
|
||||
}
|
||||
if (field.value.type.base_type == BASE_TYPE_VECTOR) {
|
||||
if (IsVector(field.value.type)) {
|
||||
GetVectorLen(field, code_ptr);
|
||||
if (field.value.type.element == BASE_TYPE_UCHAR) {
|
||||
GetUByte(field, code_ptr);
|
||||
@@ -735,7 +735,7 @@ class PhpGenerator : public BaseGenerator {
|
||||
} else {
|
||||
BuildFieldOfTable(field, offset, code_ptr);
|
||||
}
|
||||
if (field.value.type.base_type == BASE_TYPE_VECTOR) {
|
||||
if (IsVector(field.value.type)) {
|
||||
BuildVectorOfTable(field, code_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user