added mio_jsonwr_writerawuchars()

This commit is contained in:
hyung-hwan 2020-06-01 09:09:40 +00:00
parent a281cfaceb
commit e194ed01ff
2 changed files with 39 additions and 5 deletions

View File

@ -1148,8 +1148,27 @@ jsonwr->pretty = 1;
return 0; return 0;
} }
int mio_jsonwr_writerawbytes (mio_jsonwr_t* jsonwr, const mio_uint8_t* dptr, mio_oow_t dlen) int mio_jsonwr_writerawuchars (mio_jsonwr_t* jsonwr, const mio_uch_t* dptr, mio_oow_t dlen)
{
WRITE_UCHARS (jsonwr, 0, dptr, dlen);
return 0;
}
int mio_jsonwr_writerawucstr (mio_jsonwr_t* jsonwr, const mio_uch_t* dptr)
{
WRITE_UCHARS (jsonwr, 0, dptr, mio_count_ucstr(dptr));
return 0;
}
int mio_jsonwr_writerawbchars (mio_jsonwr_t* jsonwr, const mio_bch_t* dptr, mio_oow_t dlen)
{ {
WRITE_BYTES_NOESC (jsonwr, dptr, dlen); WRITE_BYTES_NOESC (jsonwr, dptr, dlen);
return 0; return 0;
} }
int mio_jsonwr_writerawbcstr (mio_jsonwr_t* jsonwr, const mio_bch_t* dptr)
{
WRITE_BYTES_NOESC (jsonwr, dptr, mio_count_bcstr(dptr));
return 0;
}

View File

@ -309,11 +309,26 @@ MIO_EXPORT int mio_jsonwr_write (
#define mio_jsonwr_writestringwithbcstr(jsonwr,dptr) mio_jsonwr_write(jsonwr, MIO_JSON_INST_STRING, 0, dptr, mio_count_bcstr(dptr)) #define mio_jsonwr_writestringwithbcstr(jsonwr,dptr) mio_jsonwr_write(jsonwr, MIO_JSON_INST_STRING, 0, dptr, mio_count_bcstr(dptr))
MIO_EXPORT int mio_jsonwr_writerawuchars (
mio_jsonwr_t* jsonwr,
const mio_uch_t* dptr,
mio_oow_t dlen
);
MIO_EXPORT int mio_jsonwr_writerawbytes ( MIO_EXPORT int mio_jsonwr_writerawucstr (
mio_jsonwr_t* jsonwr, mio_jsonwr_t* jsonwr,
const mio_uint8_t* dptr, const mio_uch_t* dptr
mio_oow_t dlen );
MIO_EXPORT int mio_jsonwr_writerawbchars (
mio_jsonwr_t* jsonwr,
const mio_bch_t* dptr,
mio_oow_t dlen
);
MIO_EXPORT int mio_jsonwr_writerawbcstr (
mio_jsonwr_t* jsonwr,
const mio_bch_t* dptr
); );
#if defined(__cplusplus) #if defined(__cplusplus)