R/json-opts.R
yyjson_write_flag.Rd
This is a list of integer values used for setting flags on the yyjson
code directly. This is an ADVANCED option and should be used with caution.
yyjson_write_flag
An object of class list
of length 9.
Some of these settings overlap and conflict with code needed to handle the translation of JSON values to R.
opts_write_json(yyjson_write_flag = c(write_flag$x, write_flag$y, ...))
Default value.
Write JSON minify.
Report error on inf or nan number.
Report error on invalid UTF-8 string.
Do not escape unicode or slash.
Write JSON pretty with 4 space indent.
Escape unicode as uXXXX
, make the
output ASCII only.
Escape '/' as '\/'.
Write inf and nan number as 'Infinity' and 'NaN' literal (non-standard).
Write inf and nan number as null literal.
This flag will override YYJSON_WRITE_ALLOW_INF_AND_NAN
flag.
Allow invalid unicode when encoding
string values (non-standard).
Invalid characters in string value will be copied byte by byte.
If YYJSON_WRITE_ESCAPE_UNICODE
flag is also set, invalid character will be
escaped as U+FFFD
(replacement character).
This flag does not affect the performance of correctly encoded strings.
Write JSON pretty with 2 space indent.
This flag will override YYJSON_WRITE_PRETTY
flag.
Adds a newline character at the end of the JSON. This can be helpful for text editors or NDJSON
write_json_str("hello/there", opts = opts_write_json(
yyjson_write_flag = yyjson_write_flag$YYJSON_WRITE_ESCAPE_SLASHES
))
#> [1] "[\"hello\\/there\"]"