| 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()) { |
nothing calls this directly
no test coverage detected