MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / AsTypedVector

Method AsTypedVector

Libs/flatbuffers/flexbuffers.h:617–634  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

615 }
616
617 TypedVector AsTypedVector() const {
618 if (IsTypedVector()) {
619 auto tv =
620 TypedVector(Indirect(), byte_width_, ToTypedVectorElementType(type_));
621 if (tv.type_ == FBT_STRING) {
622 // These can't be accessed as strings, since we don't know the bit-width
623 // of the size field, see the declaration of
624 // FBT_VECTOR_STRING_DEPRECATED above for details.
625 // We change the type here to be keys, which are a subtype of strings,
626 // and will ignore the size field. This will truncate strings with
627 // embedded nulls.
628 tv.type_ = FBT_KEY;
629 }
630 return tv;
631 } else {
632 return TypedVector::EmptyTypedVector();
633 }
634 }
635
636 FixedTypedVector AsFixedTypedVector() const {
637 if (IsFixedTypedVector()) {

Callers

nothing calls this directly

Calls 4

IsTypedVectorFunction · 0.85
IndirectFunction · 0.85
ToTypedVectorElementTypeFunction · 0.85
TypedVectorFunction · 0.70

Tested by

no test coverage detected