| 169 | // Gets an array value and writes it in JSON format. |
| 170 | template <class JsonStream> |
| 171 | void ComplexValueWriter<JsonStream>::ArrayValueToJSON(const CollectionValue& array_value, |
| 172 | const TupleDescriptor* item_tuple_desc) { |
| 173 | DCHECK(item_tuple_desc != nullptr); |
| 174 | |
| 175 | const int item_byte_size = item_tuple_desc->byte_size(); |
| 176 | const vector<SlotDescriptor*>& slot_descs = item_tuple_desc->slots(); |
| 177 | |
| 178 | DCHECK(slot_descs.size() == 1); |
| 179 | DCHECK(slot_descs[0] != nullptr); |
| 180 | |
| 181 | writer_->StartArray(); |
| 182 | |
| 183 | for (int i = 0; i < array_value.num_tuples; ++i) { |
| 184 | Tuple* item_tuple = reinterpret_cast<Tuple*>( |
| 185 | array_value.ptr + i * item_byte_size); |
| 186 | const SlotDescriptor& value_slot_desc = *slot_descs[0]; |
| 187 | CollectionElementToJSON(item_tuple, value_slot_desc, false); |
| 188 | } |
| 189 | |
| 190 | writer_->EndArray(); |
| 191 | } |
| 192 | |
| 193 | // Gets a map value and writes it in JSON format. |
| 194 | template <class JsonStream> |
nothing calls this directly
no test coverage detected