Add support for TaintedString
This commit is contained in:
parent
3b0c9eafa4
commit
32f75d93b0
|
@ -382,6 +382,9 @@ proc readValue*[T](r: var JsonReader, value: var T)
|
||||||
value = r.lexer.strVal
|
value = r.lexer.strVal
|
||||||
r.lexer.next()
|
r.lexer.next()
|
||||||
|
|
||||||
|
elif value is TaintedString:
|
||||||
|
value = TaintedString r.readValue(string)
|
||||||
|
|
||||||
elif value is seq[char]:
|
elif value is seq[char]:
|
||||||
r.requireToken tkString
|
r.requireToken tkString
|
||||||
value.setLen(r.lexer.strVal.len)
|
value.setLen(r.lexer.strVal.len)
|
||||||
|
|
|
@ -181,6 +181,9 @@ proc writeValue*(w: var JsonWriter, value: auto) =
|
||||||
|
|
||||||
append '"'
|
append '"'
|
||||||
|
|
||||||
|
elif value is TaintedString:
|
||||||
|
writeValue(w, string value)
|
||||||
|
|
||||||
elif value is bool:
|
elif value is bool:
|
||||||
append if value: "true" else: "false"
|
append if value: "true" else: "false"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue