JsonDoc
Top level JSON type containing an entire document. A JSON document consists of exactly 1 value.
class ref JsonDoc
Constructors
create
Default constructor building a document containing a single null.
new ref create() : JsonDoc ref^
Returns
- JsonDoc ref^
Public fields
var data: (F64 val | I64 val | Bool val |
[None](builtin-None.md) val | [String](builtin-String.md) val | [JsonArray](json-JsonArray.md) ref | [JsonObject](json-JsonObject.md) ref)
The parsed JSON structure.
Will be a None
if parse(source: String)
has not been called yet.
Public Functions
string
Generate string representation of this document.
fun box string( indent: String val = "", pretty_print: Bool val = false) : String val
Parameters
Returns
- String val
parse
Parse the given string as a JSON file, building a document. Raise error on invalid JSON in given source.
fun ref parse( source: String val) : None val ?
Parameters
- source: String val
Returns
- None val ?
parse_report
Give details of the error that occurred last time we attempted to parse. If parse was successful returns (0, "").
fun box parse_report() : (USize val , String val)
Returns
© 2016-2020, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/json-JsonDoc