Add JsonWriter helper procs to README.md

This commit is contained in:
jangko 2023-12-27 12:12:14 +07:00
parent 61a03e20d3
commit ff62eb1f87
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
1 changed files with 18 additions and 0 deletions

View File

@ -234,6 +234,24 @@ skipSingleJsValue(r: var JsonReader)
readRecordValue[T](r: var JsonReader, value: var T)
```
## Helper procs of JsonWriter
```Nim
beginRecord(w: var JsonWriter, T: type)
beginRecord(w: var JsonWriter)
endRecord(w: var JsonWriter)
writeFieldName(w: var JsonWriter, name: string)
writeField(w: var JsonWriter, name: string, value: auto)
iterator stepwiseArrayCreation[C](w: var JsonWriter, collection: C): auto
writeIterable(w: var JsonWriter, collection: auto)
writeArray[T](w: var JsonWriter, elements: openArray[T])
writeNumber[F,T](w: var JsonWriter[F], value: JsonNumber[T])
writeJsonValueRef[F,T](w: var JsonWriter[F], value: JsonValueRef[T])
```
## License
Licensed and distributed under either of