| 546 | } |
| 547 | |
| 548 | void CrawlStoreValue::read(reader &th) |
| 549 | { |
| 550 | ASSERT(type == SV_NONE); |
| 551 | |
| 552 | type = static_cast<store_val_type>(unmarshallByte(th)); |
| 553 | flags = (store_flags) unmarshallByte(th); |
| 554 | |
| 555 | ASSERT(type != SV_NONE || (flags & SFLAG_UNSET)); |
| 556 | ASSERT(!(flags & SFLAG_UNSET) || type == SV_NONE); |
| 557 | |
| 558 | switch (type) |
| 559 | { |
| 560 | case SV_BOOL: |
| 561 | val.boolean = unmarshallBoolean(th); |
| 562 | break; |
| 563 | |
| 564 | case SV_BYTE: |
| 565 | val.byte = unmarshallByte(th); |
| 566 | break; |
| 567 | |
| 568 | case SV_SHORT: |
| 569 | val._short = unmarshallShort(th); |
| 570 | break; |
| 571 | |
| 572 | case SV_INT: |
| 573 | val._int = unmarshallInt(th); |
| 574 | break; |
| 575 | |
| 576 | case SV_INT64: |
| 577 | val._int64 = unmarshallSigned(th); |
| 578 | break; |
| 579 | |
| 580 | case SV_FLOAT: |
| 581 | val._float = unmarshallFloat(th); |
| 582 | break; |
| 583 | |
| 584 | case SV_STR: |
| 585 | { |
| 586 | string str = unmarshallString(th); |
| 587 | val.ptr = (void*) new string(str); |
| 588 | break; |
| 589 | } |
| 590 | |
| 591 | case SV_STR_LONG: |
| 592 | { |
| 593 | val.ptr = (void*) new string(); |
| 594 | unmarshallString4(th, *static_cast<string *>(val.ptr)); |
| 595 | // SV_STR_LONG is used only for saving |
| 596 | type = SV_STR; |
| 597 | break; |
| 598 | } |
| 599 | |
| 600 | case SV_COORD: |
| 601 | { |
| 602 | const coord_def coord = unmarshallCoord(th); |
| 603 | val.ptr = (void*) new coord_def(coord); |
| 604 | |
| 605 | break; |
nothing calls this directly
no test coverage detected