Function
parse_bool
Source from the content-addressed store, hash-verified
| 152 | } |
| 153 | |
| 154 | bool parse_bool(const char *json) |
| 155 | { |
| 156 | CE_ENSURE(NULL != json); |
| 157 | |
| 158 | switch (*json) { |
| 159 | case 't': |
| 160 | json = next(json, 't'); |
| 161 | json = next(json, 'r'); |
| 162 | json = next(json, 'u'); |
| 163 | next(json, 'e'); |
| 164 | return true; |
| 165 | |
| 166 | case 'f': |
| 167 | json = next(json, 'f'); |
| 168 | json = next(json, 'a'); |
| 169 | json = next(json, 'l'); |
| 170 | json = next(json, 's'); |
| 171 | next(json, 'e'); |
| 172 | return false; |
| 173 | |
| 174 | default: |
| 175 | CE_FATAL("Bad boolean"); |
| 176 | return false; |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | void parse_string(DynamicString &str, const char *json) |
| 181 | { |