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

Method getBool

valdi_protobuf/src/valdi_protobuf/Field.cpp:566–579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

564}
565
566bool Field::getBool() const {
567 switch (_type) {
568 case InternalType::Varint:
569 return _data.varint != 0;
570 case InternalType::Fixed64:
571 return _data.fixed64 != 0;
572 case InternalType::Fixed32:
573 return _data.fixed32 != 0;
574 case InternalType::Unset:
575 case InternalType::Raw:
576 case InternalType::Ref:
577 return false;
578 }
579}
580
581void Field::setBool(bool v) {
582 setVarint(v ? 1 : 0);

Callers 2

TESTFunction · 0.45

Calls

no outgoing calls

Tested by 2

TESTFunction · 0.36