diff options
author | Jehiah Czebotar <jehiah@gmail.com> | 2011-01-14 17:23:06 +0000 |
---|---|---|
committer | Jehiah Czebotar <jehiah@gmail.com> | 2011-01-14 17:23:06 +0000 |
commit | ac601b5b5f9bc76200a37f39a47a62d414708aa2 (patch) | |
tree | 777492c82134c76f0ef4571af17c06aa83ca5e2c /json_object.h | |
parent | a503ee8217a9912f3c58acae33cf3d1d840dab6c (diff) |
update json_object_new_string_len, json_escape_str (internal). Writer handles \x00 correctly
Added parse_null test. This does not change anything with how the parser handles \u0000 or null characters
This commit is addapted from one by Adomas Paltanavičius <adomas@leanholding.com>
git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@63 327403b1-1117-474d-bef2-5cb71233fd97
Diffstat (limited to 'json_object.h')
-rw-r--r-- | json_object.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/json_object.h b/json_object.h index 9a44c6e..d8fdc29 100644 --- a/json_object.h +++ b/json_object.h @@ -337,6 +337,16 @@ extern struct json_object* json_object_new_string_len(const char *s, int len); */ extern const char* json_object_get_string(struct json_object *obj); +/** Get the string length of a json_object + * + * If the passed object is not of type json_type_string then zero + * will be returned. + * + * @param obj the json_object instance + * @returns int + */ +extern int json_object_get_string_len(struct json_object *obj); + #ifdef __cplusplus } #endif |