Example #1
0
void YAJLStr(char **value, yajl_val node, const char *name)
{
	if (!YAJLTryLoadValue(&node, name) || !YAJL_IS_STRING(node))
	{
		return;
	}
	*value = YAJLGetStr(node, name);
}
Example #2
0
void YAJLVec2i(Vec2i *value, yajl_val node, const char *name)
{
	if (!YAJLTryLoadValue(&node, name) || !YAJL_IS_ARRAY(node))
	{
		return;
	}
	*value = YAJL_GET_VEC2I(node);
}
Example #3
0
void YAJLDouble(double *value, yajl_val node, const char *name)
{
	if (!YAJLTryLoadValue(&node, name) || !YAJL_IS_DOUBLE(node))
	{
		return;
	}
	*value = YAJL_GET_DOUBLE(node);
}
Example #4
0
void YAJLInt(int *value, yajl_val node, const char *name)
{
	if (!YAJLTryLoadValue(&node, name) || !YAJL_IS_INTEGER(node))
	{
		return;
	}
	*value = (int)YAJL_GET_INTEGER(node);
}
Example #5
0
void YAJLBool(bool *value, yajl_val node, const char *name)
{
	if (!YAJLTryLoadValue(&node, name))
	{
		return;
	}
	*value = YAJL_IS_TRUE(node);
}
Example #6
0
void YAJLVec2i(Vec2i *value, yajl_val node, const char *name)
{
	if (!YAJLTryLoadValue(&node, name) || !YAJL_IS_ARRAY(node))
	{
		return;
	}
	value->x = (int)YAJL_GET_INTEGER(YAJL_GET_ARRAY(node)->values[0]);
	value->y = (int)YAJL_GET_INTEGER(YAJL_GET_ARRAY(node)->values[1]);
}