X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=include%2Fyaz%2Fwrbuf.h;h=3864c3e275b4d6a4a4409bfb309fb7f6ece60686;hp=d716af06e020042360d2234ba931a0349c3d3d42;hb=574ae68dc570706b4468b29e82681efe15bc7180;hpb=bbfac2e92dee794029b7a2ee6c843c9b99e22cc3 diff --git a/include/yaz/wrbuf.h b/include/yaz/wrbuf.h index d716af0..3864c3e 100644 --- a/include/yaz/wrbuf.h +++ b/include/yaz/wrbuf.h @@ -232,6 +232,29 @@ YAZ_EXPORT const char *wrbuf_cstr(WRBUF b); ((void) ((b)->pos >= (b)->size ? wrbuf_grow(b, 1) : 0), \ (b)->buf[(b)->pos++] = (c), 0) + +/** \brief writes JSON text to WRBUF with escaping + \param b result + \param str input string to be encoded +*/ +YAZ_EXPORT +void wrbuf_json_puts(WRBUF b, const char *str); + +/** \brief writes JSON text to WRBUF with escaping + \param b result + \param cp char buffer + \param sz size of char buffer +*/ +YAZ_EXPORT +void wrbuf_json_write(WRBUF b, const char *cp, size_t sz); + +YAZ_EXPORT +void wrbuf_iconv_json_write(WRBUF b, yaz_iconv_t cd, + const char *buf, size_t size); + +YAZ_EXPORT +void wrbuf_iconv_json_puts(WRBUF b, yaz_iconv_t cd, const char *strz); + YAZ_END_CDECL #endif