ibireme / yyjson

The fastest JSON library in C
https://ibireme.github.io/yyjson/doc/doxygen/html/
MIT License
3.04k stars 262 forks source link

Raw values fixes and improvements #77

Closed pavelxdd closed 2 years ago

pavelxdd commented 2 years ago

I need creating raw values when their contents is already allocated in the doc, so I don't need extra copying.

I added 4 raw values creation functions, which are basically the same as mut_str functions, except the value type is YYJSON_TYPE_RAW.

Also fixed writing raw values in mut_val_write_opts, seems like the raw values support was forgotten there.

codecov[bot] commented 2 years ago

Codecov Report

Merging #77 (4edb7ff) into master (5cb87de) will decrease coverage by 0.70%. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master      #77      +/-   ##
==========================================
- Coverage   98.50%   97.80%   -0.71%     
==========================================
  Files           2        2              
  Lines        2076     2091      +15     
==========================================
  Hits         2045     2045              
- Misses         31       46      +15     
Impacted Files Coverage Δ
src/yyjson.c 98.03% <0.00%> (-0.75%) :arrow_down:
src/yyjson.h 93.39% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5cb87de...4edb7ff. Read the comment docs.

ibireme commented 2 years ago

Yes, that should be a bug. YYJSON_TYPE_RAW is forgotten in many places.