inline double jsonFloatProp(JSONNode &n, const char* prop, double def){ JSONNode::iterator i = n.find(prop); if (i != n.end() && i->type() == JSON_NUMBER) return i->as_float(); else return def; }
inline double jsonFloatProp(JSONNode &n, const char* prop){ JSONNode::iterator i = n.find(prop); if (i != n.end() && i->type() == JSON_NUMBER) return i->as_float(); else throw ErrorStringException(string("JSON missing float property: ") + prop); }