Read a top-level string field. Returns empty string if the key is missing. Throws on type mismatch.
| 271 | /// Read a top-level string field. Returns empty string if the key is missing. |
| 272 | /// Throws on type mismatch. |
| 273 | String getStringField(const Poco::JSON::Object::Ptr & object, const char * key) |
| 274 | { |
| 275 | if (!object->has(key)) |
| 276 | return {}; |
| 277 | return object->getValue<String>(key); |
| 278 | } |
| 279 | |
| 280 | /// Read a top-level integer field, clamped to [0, max_value]. Returns -1 if |
| 281 | /// the key is missing. Throws on type mismatch. |
no test coverage detected