library/src/javascript/JSON/BP-JSON.cc
// Append from buffer using table path.
Append from buffer using table path.
Append from buffer using table path .
BP_ERROR_T BP_JSONAppendFromBufferByTablePath
(
		P_BP_JSON  json,
		char      *json_buffer,
		size_t     max_depth_for_token_allocation,
		size_t     max_tokens_total,
		char      *new_appended_table_name,
		char     **initial_append_path,
		BP_BOOL    include_data,
		BP_BOOL    base64_encode_bin_data
)
{
	if(!json_buffer)
		return ERR_FAILURE;
	if(!BP_StringIsReasonablePrintableString(json_buffer, bpstrlen(json_buffer), BP_TRUE, BP_TRUE))
		return ERR_FAILURE;
	P_BP_JSON arbitrary_json = BP_JSONCreateFromBuffer
	(
		json_buffer,
		bpstrlen(json_buffer),
		max_depth_for_token_allocation,
		max_tokens_total
	);
	if(!arbitrary_json)
		return ERR_FAILURE;
	BP_ERROR_T ret_val =  BP_JSONAppendByTablePath
	(
		json,
		arbitrary_json,
		new_appended_table_name,
		initial_append_path,
		include_data,
		base64_encode_bin_data
	);
	BP_JSONDestroy(arbitrary_json);
	return ret_val;
}
BP_ERROR_T BP_JSONAppendFromBufferByTablePath ( P_BP_JSON json , char * json_buffer , size_t max_depth_for_token_allocation , size_t max_tokens_total , char * new_appended_table_name , char * * initial_append_path , BP_BOOL include_data , BP_BOOL base64_encode_bin_data ) { if ( ! json_buffer ) return ERR_FAILURE ; if ( ! BP_StringIsReasonablePrintableString ( json_buffer , bpstrlen ( json_buffer ) , BP_TRUE , BP_TRUE ) ) return ERR_FAILURE ; P_BP_JSON arbitrary_json = BP_JSONCreateFromBuffer ( json_buffer , bpstrlen ( json_buffer ) , max_depth_for_token_allocation , max_tokens_total ) ; if ( ! arbitrary_json ) return ERR_FAILURE ; BP_ERROR_T ret_val = BP_JSONAppendByTablePath ( json , arbitrary_json , new_appended_table_name , initial_append_path , include_data , base64_encode_bin_data ) ; BP_JSONDestroy ( arbitrary_json ) ; return ret_val ; }
Append from buffer using table path.
Append from buffer using table path .
// json buffer // load json from buffer // ensure json was created ok // run addition // destroy arbitrary json // return the value