]> gitweb.factorcode.org Git - factor.git/blob - basis/json/reader/reader-docs.factor
factor: trim using lists
[factor.git] / basis / json / reader / reader-docs.factor
1 ! Copyright (C) 2006 Chris Double.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.markup help.syntax ;
4 IN: json.reader
5
6 HELP: json>
7 { $values { "string" "a string in JSON format" } { "object" "a deserialized object" } }
8 { $description "Deserializes the JSON formatted string into a Factor object. JSON objects are converted to Factor hashtables. All other JSON objects convert to their obvious Factor equivalents." } ;
9
10 HELP: read-json
11 { $values { "objects" { $sequence "deserialized objects" } } }
12 { $description "Reads JSON formatted strings into a vector of Factor object until the end of the stream is reached. JSON objects are converted to Factor hashtables. All other JSON objects convert to their obvious Factor equivalents." } ;
13
14 HELP: path>json
15 { $values
16     { "path" "a pathname string" }
17     { "json" "a JSON object" }
18 }
19 { $description "Reads a file into a single JSON object. Throws an error if the file contains more than one json." } ;
20 { path>json path>jsons } related-words
21
22 HELP: path>jsons
23 { $values
24     { "path" "a pathname string" }
25     { "jsons" { $sequence "JSON objects" } }
26 }
27 { $description "Reads a file into a sequence of JSON objects and returns them all." } ;
28
29 ARTICLE: "json.reader" "JSON reader"
30 "The " { $vocab-link "json.reader" } " vocabulary defines a word for parsing strings in JSON format."
31 "For more information, see " { $url "https://en.wikipedia.org/wiki/JSON" } "."
32 { $subsections json> read-json path>json path>jsons } ;
33
34 ABOUT: "json.reader"