diff options
author | Damien George <damien.p.george@gmail.com> | 2014-09-25 17:35:56 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-09-25 17:35:56 +0100 |
commit | cde0ca21bf79420386c7cb31de29b0f799f16655 (patch) | |
tree | a11355475cffce12ebcc89b75857a80f400abb7f /py/objstr.h | |
parent | d19c256656d62397344a39351082281039d612c0 (diff) |
py: Simplify JSON str printing (while still conforming to JSON spec).
The JSON specs are relatively flexible and allow us to use one function
to print strings, be they ascii, bytes or utf-8 encoded.
Diffstat (limited to 'py/objstr.h')
-rw-r--r-- | py/objstr.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/py/objstr.h b/py/objstr.h index 3d20680d3..8cd485294 100644 --- a/py/objstr.h +++ b/py/objstr.h @@ -50,6 +50,7 @@ typedef struct _mp_obj_str_t { { str_data = qstr_data(MP_OBJ_QSTR_VALUE(str_obj_in), &str_len); } \ else { str_len = ((mp_obj_str_t*)str_obj_in)->len; str_data = ((mp_obj_str_t*)str_obj_in)->data; } +void mp_str_print_json(void (*print)(void *env, const char *fmt, ...), void *env, const byte *str_data, mp_uint_t str_len); mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args); mp_obj_t mp_obj_new_str_of_type(const mp_obj_type_t *type, const byte* data, mp_uint_t len); |