| 564 | } |
| 565 | |
| 566 | bool 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 | |
| 581 | void Field::setBool(bool v) { |
| 582 | setVarint(v ? 1 : 0); |
no outgoing calls