| 112 | } |
| 113 | |
| 114 | bool get_intprop(cson_value *objval, const char *key, int64_t *val) { |
| 115 | cson_object *obj; |
| 116 | cson_value_fetch_object(objval, &obj); |
| 117 | const cson_value *propval = cson_object_get(obj, key); |
| 118 | if (propval == nullptr || !cson_value_is_integer(propval)) |
| 119 | return false; |
| 120 | int rc = cson_value_fetch_integer(propval, (cson_int_t*) val); |
| 121 | if (rc) |
| 122 | return false; |
| 123 | return true; |
| 124 | } |
| 125 | |
| 126 | bool get_doubleprop(cson_value *objval, const char *key, double *val) { |
| 127 | cson_object *obj; |
no test coverage detected