소스 검색

Document %.*Q

PUBLISHED_FROM=5dc567f8978d5414835f7a2338a78ae9eb683f55
Marko Mikulicic 9 년 전
부모
커밋
e0d723c196
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      docs/api/json_printf.md

+ 3 - 0
docs/api/json_printf.md

@@ -46,6 +46,9 @@ String values get escaped when printed (see `%M` specifier).
 This is a superset of printf() function, with extra format specifiers:
 - `%B` print json boolean, `true` or `false`. Accepts an `int`.
 - `%Q` print quoted escaped string or `null`. Accepts a `const char *`.
+- `%.*Q` like `%Q` but accepts the length of the string explicitly, pretty much like `%.*s`.
+Embedded NUL bytes are supported and will be properly encoded as `\u0000`.
+Accepts an `int` length and a `const char *`.
 - `%M` invokes a json_printf_callback_t function. That callback function
 can consume more parameters.