| 714 | } |
| 715 | |
| 716 | void Serializer::begin_array_internal(FieldType item_type, bool compack) { |
| 717 | if (!_stream->good()) { |
| 718 | return; |
| 719 | } |
| 720 | if (!array_add_item(_stream, peek_group_info(), FIELD_ARRAY, 1)) { |
| 721 | return _stream->set_bad(); |
| 722 | } |
| 723 | GroupInfo* info = push_group_info(); |
| 724 | if (info == NULL) { |
| 725 | CHECK(false) << "Fail to push array"; |
| 726 | return _stream->set_bad(); |
| 727 | } |
| 728 | info->item_count = 0; |
| 729 | info->item_type = item_type; |
| 730 | info->type = FIELD_ARRAY; |
| 731 | info->name_size = 0; |
| 732 | info->output_offset = _stream->pushed_bytes(); |
| 733 | info->pending_null_count = 0; |
| 734 | info->head_area = _stream->reserve(sizeof(FieldLongHead)); |
| 735 | if (compack && get_primitive_type_size(item_type)) { |
| 736 | info->isomorphic = true; |
| 737 | info->items_head_area = INVALID_AREA; |
| 738 | _stream->push_back((char)item_type); |
| 739 | } else { |
| 740 | info->isomorphic = false; |
| 741 | info->items_head_area = _stream->reserve(sizeof(ItemsHead)); |
| 742 | } |
| 743 | } |
| 744 | |
| 745 | void Serializer::begin_array_internal(const StringWrapper& name, |
| 746 | FieldType item_type, |
nothing calls this directly
no test coverage detected