示例#1
0
文件: packr.cpp 项目: AlEmerich/packr
static bool hasJsonValue(sajson::value jsonObject, const char* key, sajson::type expectedType) {
	size_t index = jsonObject.find_object_key(sajson::literal(key));
	if (index == jsonObject.get_length()) {
		return false;
	}
	sajson::value value = jsonObject.get_object_value(index);
	return value.get_type() == expectedType;
}
示例#2
0
文件: packr.cpp 项目: AlEmerich/packr
static sajson::value getJsonValue(sajson::value jsonObject, const char* key) {
	size_t index = jsonObject.find_object_key(sajson::literal(key));
	return jsonObject.get_object_value(index);
}