| 71 | } |
| 72 | |
| 73 | Result<bool> GetBool(const char* key) const { |
| 74 | if (!document_.HasMember(key)) { |
| 75 | return Status::KeyError("Key '", key, "' does not exist"); |
| 76 | } |
| 77 | if (!document_[key].IsBool()) { |
| 78 | return Status::TypeError("Key '", key, "' is not a boolean"); |
| 79 | } |
| 80 | return document_[key].GetBool(); |
| 81 | } |
| 82 | |
| 83 | private: |
| 84 | rj::Document document_; |