mirror of
https://github.com/json-c/json-c.git
synced 2026-03-13 18:19:06 +08:00
json_pointer: fix comments about printf() variants of set/get()
These were wrong. Some details about the json_pointer_setf() & json_pointer_getf() were added in the json_pointer_set() & json_pointer_get() doc-strings. This change removes them. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
This commit is contained in:
committed by
Eric Hawicz
parent
71d845e819
commit
5568916eb1
@@ -32,11 +32,6 @@ extern "C" {
|
|||||||
* Internally, this is equivalent to doing a series of 'json_object_object_get()'
|
* Internally, this is equivalent to doing a series of 'json_object_object_get()'
|
||||||
* and 'json_object_array_get_idx()' along the given 'path'.
|
* and 'json_object_array_get_idx()' along the given 'path'.
|
||||||
*
|
*
|
||||||
* Note that the 'path' string supports 'printf()' type arguments, so, whatever
|
|
||||||
* is added after the 'res' param will be treated as an argument for 'path'
|
|
||||||
* Example: json_pointer_get(obj, "/foo/%d/%s", &res, 0, bar)
|
|
||||||
* This means, that you need to escape '%' with '%%' (just like in printf())
|
|
||||||
*
|
|
||||||
* @param obj the json_object instance/tree from where to retrieve sub-objects
|
* @param obj the json_object instance/tree from where to retrieve sub-objects
|
||||||
* @param path a (RFC6901) string notation for the sub-object to retrieve
|
* @param path a (RFC6901) string notation for the sub-object to retrieve
|
||||||
* @param res a pointer that stores a reference to the json_object
|
* @param res a pointer that stores a reference to the json_object
|
||||||
@@ -50,7 +45,9 @@ JSON_EXPORT int json_pointer_get(struct json_object *obj, const char *path,
|
|||||||
/**
|
/**
|
||||||
* This is a variant of 'json_pointer_get()' that supports printf() style arguments.
|
* This is a variant of 'json_pointer_get()' that supports printf() style arguments.
|
||||||
*
|
*
|
||||||
* Example: json_pointer_getf(obj, res, "/foo/%d/%s", 0, bak)
|
* Variable arguments go after the 'path_fmt' parameter.
|
||||||
|
*
|
||||||
|
* Example: json_pointer_getf(obj, res, "/foo/%d/%s", 0, "bar")
|
||||||
* This also means that you need to escape '%' with '%%' (just like in printf())
|
* This also means that you need to escape '%' with '%%' (just like in printf())
|
||||||
*
|
*
|
||||||
* Please take into consideration all recommended 'printf()' format security
|
* Please take into consideration all recommended 'printf()' format security
|
||||||
@@ -84,11 +81,6 @@ JSON_EXPORT int json_pointer_getf(struct json_object *obj, struct json_object **
|
|||||||
* That also implies that 'json_pointer_set()' does not do any refcount incrementing.
|
* That also implies that 'json_pointer_set()' does not do any refcount incrementing.
|
||||||
* (Just that single decrement that was mentioned above).
|
* (Just that single decrement that was mentioned above).
|
||||||
*
|
*
|
||||||
* Note that the 'path' string supports 'printf()' type arguments, so, whatever
|
|
||||||
* is added after the 'value' param will be treated as an argument for 'path'
|
|
||||||
* Example: json_pointer_set(obj, "/foo/%d/%s", value, 0, bak)
|
|
||||||
* This means, that you need to escape '%' with '%%' (just like in printf())
|
|
||||||
*
|
|
||||||
* @param obj the json_object instance/tree to which to add a sub-object
|
* @param obj the json_object instance/tree to which to add a sub-object
|
||||||
* @param path a (RFC6901) string notation for the sub-object to set in the tree
|
* @param path a (RFC6901) string notation for the sub-object to set in the tree
|
||||||
* @param value object to set at path
|
* @param value object to set at path
|
||||||
@@ -101,7 +93,9 @@ JSON_EXPORT int json_pointer_set(struct json_object **obj, const char *path,
|
|||||||
/**
|
/**
|
||||||
* This is a variant of 'json_pointer_set()' that supports printf() style arguments.
|
* This is a variant of 'json_pointer_set()' that supports printf() style arguments.
|
||||||
*
|
*
|
||||||
* Example: json_pointer_setf(obj, value, "/foo/%d/%s", 0, bak)
|
* Variable arguments go after the 'path_fmt' parameter.
|
||||||
|
*
|
||||||
|
* Example: json_pointer_setf(obj, value, "/foo/%d/%s", 0, "bar")
|
||||||
* This also means that you need to escape '%' with '%%' (just like in printf())
|
* This also means that you need to escape '%' with '%%' (just like in printf())
|
||||||
*
|
*
|
||||||
* Please take into consideration all recommended 'printf()' format security
|
* Please take into consideration all recommended 'printf()' format security
|
||||||
|
|||||||
Reference in New Issue
Block a user