| 251 | } |
| 252 | |
| 253 | size_t unbox(InputStream* stream) { |
| 254 | FieldLongHead head; |
| 255 | if (stream->cut_packed_pod(&head) != sizeof(FieldLongHead)) { |
| 256 | CHECK(false) << "Input buffer is not enough"; |
| 257 | return 0; |
| 258 | } |
| 259 | if (head.type() != FIELD_OBJECT) { |
| 260 | CHECK(false) << "type=" << type2str(head.type()) << " is not object"; |
| 261 | return 0; |
| 262 | } |
| 263 | if (!(head.type() & FIELD_NON_DELETED_MASK)) { |
| 264 | CHECK(false) << "The item is deleted"; |
| 265 | return 0; |
| 266 | } |
| 267 | if (head.name_size() != 0) { |
| 268 | CHECK(false) << "The object should not have name"; |
| 269 | return 0; |
| 270 | } |
| 271 | return head.value_size(); |
| 272 | } |
| 273 | |
| 274 | std::ostream& operator<<(std::ostream& os, const UnparsedValue& value) { |
| 275 | // TODO(gejun): More info. |
no test coverage detected