MCPcopy Create free account
hub / github.com/crawl/crawl / read

Method read

crawl-ref/source/store.cc:548–678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546}
547
548void 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;

Callers

nothing calls this directly

Calls 15

unmarshallByteFunction · 0.85
unmarshallBooleanFunction · 0.85
unmarshallShortFunction · 0.85
unmarshallIntFunction · 0.85
unmarshallFloatFunction · 0.85
unmarshallStringFunction · 0.85
unmarshallString4Function · 0.85
unmarshallCoordFunction · 0.85
unmarshallItemFunction · 0.85
getMinorVersionMethod · 0.80
unmarshallSignedFunction · 0.70
dieFunction · 0.70

Tested by

no test coverage detected