MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getDouble

Method getDouble

valdi_protobuf/src/valdi_protobuf/Field.cpp:604–617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

602}
603
604double Field::getDouble() const {
605 switch (_type) {
606 case InternalType::Varint:
607 return WireFormat::DecodeDouble(_data.varint);
608 case InternalType::Fixed64:
609 return WireFormat::DecodeDouble(_data.fixed64);
610 case InternalType::Fixed32:
611 return static_cast<double>(WireFormat::DecodeFloat(_data.fixed32));
612 case InternalType::Unset:
613 case InternalType::Raw:
614 case InternalType::Ref:
615 return 0;
616 }
617}
618
619void Field::setDouble(double v) {
620 setFixed64(WireFormat::EncodeDouble(v));

Callers 2

TESTFunction · 0.45

Calls

no outgoing calls

Tested by 2

TESTFunction · 0.36