コード例 #1
0
ファイル: json_helpers.hpp プロジェクト: nonolith/connect
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
ファイル: json_helpers.hpp プロジェクト: nonolith/connect
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);
}