| 66 | } |
| 67 | |
| 68 | Value validate(ValueType t, const Value& v, const string& name) { |
| 69 | if (v.type() != t) |
| 70 | throw err(msg() << " '" << name << "' expected " << t << ", found " << v.type()); |
| 71 | return v; |
| 72 | } |
| 73 | |
| 74 | Value get(ValueType t, const Value& obj, const char *key, const Value& dflt=Value()) { |
| 75 | Value v = obj.get(key, dflt); |