| 101 | } |
| 102 | |
| 103 | Status JsonReader::ExtractUint32(const Value* object, |
| 104 | const char* field, |
| 105 | uint32_t* result) const { |
| 106 | const Value* val; |
| 107 | RETURN_NOT_OK(ExtractField(object, field, &val)); |
| 108 | if (PREDICT_FALSE(!val->IsUint())) { |
| 109 | return Status::InvalidArgument(Substitute( |
| 110 | "wrong type during field extraction: expected uint32 but got $0", |
| 111 | TypeToString(val->GetType()))); |
| 112 | } |
| 113 | *result = val->GetUint(); |
| 114 | return Status::OK(); |
| 115 | } |
| 116 | |
| 117 | Status JsonReader::ExtractInt64(const Value* object, |
| 118 | const char* field, |