Пример #1
0
inline bool jsonBoolProp(JSONNode &n, const char* prop, bool def){
	JSONNode::iterator i = n.find(prop);
	if (i != n.end() && i->type() == JSON_BOOL) return i->as_bool();
	else return def;
}
Пример #2
0
inline bool jsonBoolProp(JSONNode &n, const char* prop){
	JSONNode::iterator i = n.find(prop);
	if (i != n.end() && i->type() == JSON_BOOL) return i->as_bool();
	else throw ErrorStringException(string("JSON missing bool property: ") + prop);
}