The json-lib Reference Manual

This is the json-lib Reference Manual, version 0.8, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sat Dec 03 21:53:05 2022 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 json-lib

A simple and relatively fast JSON parser and encoder

Author

Alex Nygren, KINA, LLC

License

MIT

Version

0.8

Dependencies
  • alexandria (system).
  • str (system).
  • parse-float (system).
  • cl-fad (system).
  • babel (system).
Source

json-lib.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 json-lib/json-lib.asd

Source

json-lib.asd.

Parent Component

json-lib (system).

ASDF Systems

json-lib.


3.1.2 json-lib/package.lisp

Source

json-lib.asd.

Parent Component

json-lib (system).

Packages

json-lib.


3.1.3 json-lib/compliance.lisp

Dependency

package.lisp (file).

Source

json-lib.asd.

Parent Component

json-lib (system).

Internals

3.1.4 json-lib/json-lib.lisp

Dependency

compliance.lisp (file).

Source

json-lib.asd.

Parent Component

json-lib (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 json-lib

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Ordinary functions

Function: encode-string (text)
Package

json-lib.

Source

json-lib.lisp.

Function: parse (json-text &key use-keywords-for-keys trace max-depth max-exponent-length object-key-handler)

Given an encoded UTF-8 JSON string, returns a Common Lisp structure or value.
If use-keywords-for-keys is T, then hash table keys will be constructed as keywords.
If an object-key-handler lambda/function is provided, this will be called for each object key and the result value used for the specific object key.
By default the limit is 1000 for structural depth, but this can be set with the keyword
max-depth. Exponent representation in serialized form is limited to a length of 2 to prevent huge values causing slow downs and other issues in the conversion process.

Package

json-lib.

Source

json-lib.lisp.

Function: stringify (data &key case-encoder unencodable-items)

Converts the given data structure to a stringified JSON form, suitable for serialization and other uses. An optional function can be passed for case encoding of native lisp keyword structures.
If a function for unencodable-items is provided, this function will be called, and should return a JSON compliant string representing the encoded items. If no value is provided for unencodable-items, the JSON null value is used.

Package

json-lib.

Source

json-lib.lisp.


5.2 Internals


5.2.1 Constants

Constant: +cap-e+
Package

json-lib.

Source

json-lib.lisp.

Constant: +cap-u+
Package

json-lib.

Source

json-lib.lisp.

Constant: +colon+
Package

json-lib.

Source

json-lib.lisp.

Constant: +comma+
Package

json-lib.

Source

json-lib.lisp.

Constant: +e+
Package

json-lib.

Source

json-lib.lisp.

Constant: +escape-char+
Package

json-lib.

Source

json-lib.lisp.

Constant: +f-char+
Package

json-lib.

Source

json-lib.lisp.

Constant: +forward-slash+
Package

json-lib.

Source

json-lib.lisp.

Constant: +hyphen+
Package

json-lib.

Source

json-lib.lisp.

Constant: +in-array+
Package

json-lib.

Source

json-lib.lisp.

Constant: +in-boolean+
Package

json-lib.

Source

json-lib.lisp.

Constant: +in-code+
Package

json-lib.

Source

json-lib.lisp.

Constant: +in-comment+
Package

json-lib.

Source

json-lib.lisp.

Constant: +in-key+
Package

json-lib.

Source

json-lib.lisp.

Constant: +in-number+
Package

json-lib.

Source

json-lib.lisp.

Constant: +in-pairs+
Package

json-lib.

Source

json-lib.lisp.

Constant: +in-qm+
Package

json-lib.

Source

json-lib.lisp.

Constant: +in-quotes+
Package

json-lib.

Source

json-lib.lisp.

Constant: +in-string+
Package

json-lib.

Source

json-lib.lisp.

Constant: +left-brace+
Package

json-lib.

Source

json-lib.lisp.

Constant: +left-bracket+
Package

json-lib.

Source

json-lib.lisp.

Constant: +new-line+
Package

json-lib.

Source

json-lib.lisp.

Constant: +period+
Package

json-lib.

Source

json-lib.lisp.

Constant: +plus+
Package

json-lib.

Source

json-lib.lisp.

Constant: +quote+
Package

json-lib.

Source

json-lib.lisp.

Constant: +right-brace+
Package

json-lib.

Source

json-lib.lisp.

Constant: +right-bracket+
Package

json-lib.

Source

json-lib.lisp.

Constant: +space+
Package

json-lib.

Source

json-lib.lisp.

Constant: +t-char+
Package

json-lib.

Source

json-lib.lisp.

Constant: +tab+
Package

json-lib.

Source

json-lib.lisp.

Constant: +u+
Package

json-lib.

Source

json-lib.lisp.


5.2.2 Special variables

Special Variable: *git-path*
Package

json-lib.

Source

compliance.lisp.

Special Variable: *json-test-repo*
Package

json-lib.

Source

compliance.lisp.

Special Variable: *verbose-mode*
Package

json-lib.

Source

compliance.lisp.


5.2.3 Ordinary functions

Function: build-parser-test-harness (&key test-directory github-repo-url show-input write-compliance-html-file)
Package

json-lib.

Source

compliance.lisp.

Function: close-result-page (outstream)
Package

json-lib.

Source

compliance.lisp.

Function: create-result-page (output-html-file)

This function creates an HTML output table showing the results of compliance to the JSON Test Suite.
Pass a file path that is in a writable location. Be sure to close the result by calling close_result_page.

Package

json-lib.

Source

compliance.lisp.

Function: dlog (&rest args)
Package

json-lib.

Source

compliance.lisp.

Function: emit-result-row (fstream count total-count test-name result test-output input)
Package

json-lib.

Source

compliance.lisp.

Function: emit-result-table-footer (fstream)
Package

json-lib.

Source

compliance.lisp.

Function: emit-result-table-header (fstream)
Package

json-lib.

Source

compliance.lisp.

Function: encode-cons (items &optional case-encoder unencodable-items)
Package

json-lib.

Source

json-lib.lisp.

Function: encode-entry (entry &optional case-encoder unencodable-items)
Package

json-lib.

Source

json-lib.lisp.

Function: encode-hash-table (table &optional case-encoder unencodable-items)
Package

json-lib.

Source

json-lib.lisp.

Function: encode-list (items &optional case-encoder unencodable-items)
Package

json-lib.

Source

json-lib.lisp.

Function: encode-vector (vect &optional case-encoder unencodable-items)
Package

json-lib.

Source

json-lib.lisp.

Function: get-tests (&key test-directory github-repo-url)
Package

json-lib.

Source

compliance.lisp.

Function: keyword-to-string (kw &optional case-encoder)
Package

json-lib.

Source

json-lib.lisp.

Function: lisp-to-camelcase (text)
Package

json-lib.

Source

json-lib.lisp.

Function: lisp-to-snakecase (text)
Package

json-lib.

Source

json-lib.lisp.

Function: lookup-escape (c)
Package

json-lib.

Source

json-lib.lisp.

Function: snakecase-to-lisp (text)
Package

json-lib.

Source

json-lib.lisp.

Function: tstring ()

Returns a standardized time stamp as a string.

Package

json-lib.

Source

compliance.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   B   C   D   E   F   G   K   L   P   S   T  
Index Entry  Section

B
build-parser-test-harness: Private ordinary functions

C
close-result-page: Private ordinary functions
create-result-page: Private ordinary functions

D
dlog: Private ordinary functions

E
emit-result-row: Private ordinary functions
emit-result-table-footer: Private ordinary functions
emit-result-table-header: Private ordinary functions
encode-cons: Private ordinary functions
encode-entry: Private ordinary functions
encode-hash-table: Private ordinary functions
encode-list: Private ordinary functions
encode-string: Public ordinary functions
encode-vector: Private ordinary functions

F
Function, build-parser-test-harness: Private ordinary functions
Function, close-result-page: Private ordinary functions
Function, create-result-page: Private ordinary functions
Function, dlog: Private ordinary functions
Function, emit-result-row: Private ordinary functions
Function, emit-result-table-footer: Private ordinary functions
Function, emit-result-table-header: Private ordinary functions
Function, encode-cons: Private ordinary functions
Function, encode-entry: Private ordinary functions
Function, encode-hash-table: Private ordinary functions
Function, encode-list: Private ordinary functions
Function, encode-string: Public ordinary functions
Function, encode-vector: Private ordinary functions
Function, get-tests: Private ordinary functions
Function, keyword-to-string: Private ordinary functions
Function, lisp-to-camelcase: Private ordinary functions
Function, lisp-to-snakecase: Private ordinary functions
Function, lookup-escape: Private ordinary functions
Function, parse: Public ordinary functions
Function, snakecase-to-lisp: Private ordinary functions
Function, stringify: Public ordinary functions
Function, tstring: Private ordinary functions

G
get-tests: Private ordinary functions

K
keyword-to-string: Private ordinary functions

L
lisp-to-camelcase: Private ordinary functions
lisp-to-snakecase: Private ordinary functions
lookup-escape: Private ordinary functions

P
parse: Public ordinary functions

S
snakecase-to-lisp: Private ordinary functions
stringify: Public ordinary functions

T
tstring: Private ordinary functions


A.3 Variables

Jump to:   *   +  
C   S  
Index Entry  Section

*
*git-path*: Private special variables
*json-test-repo*: Private special variables
*verbose-mode*: Private special variables

+
+cap-e+: Private constants
+cap-u+: Private constants
+colon+: Private constants
+comma+: Private constants
+e+: Private constants
+escape-char+: Private constants
+f-char+: Private constants
+forward-slash+: Private constants
+hyphen+: Private constants
+in-array+: Private constants
+in-boolean+: Private constants
+in-code+: Private constants
+in-comment+: Private constants
+in-key+: Private constants
+in-number+: Private constants
+in-pairs+: Private constants
+in-qm+: Private constants
+in-quotes+: Private constants
+in-string+: Private constants
+left-brace+: Private constants
+left-bracket+: Private constants
+new-line+: Private constants
+period+: Private constants
+plus+: Private constants
+quote+: Private constants
+right-brace+: Private constants
+right-bracket+: Private constants
+space+: Private constants
+t-char+: Private constants
+tab+: Private constants
+u+: Private constants

C
Constant, +cap-e+: Private constants
Constant, +cap-u+: Private constants
Constant, +colon+: Private constants
Constant, +comma+: Private constants
Constant, +e+: Private constants
Constant, +escape-char+: Private constants
Constant, +f-char+: Private constants
Constant, +forward-slash+: Private constants
Constant, +hyphen+: Private constants
Constant, +in-array+: Private constants
Constant, +in-boolean+: Private constants
Constant, +in-code+: Private constants
Constant, +in-comment+: Private constants
Constant, +in-key+: Private constants
Constant, +in-number+: Private constants
Constant, +in-pairs+: Private constants
Constant, +in-qm+: Private constants
Constant, +in-quotes+: Private constants
Constant, +in-string+: Private constants
Constant, +left-brace+: Private constants
Constant, +left-bracket+: Private constants
Constant, +new-line+: Private constants
Constant, +period+: Private constants
Constant, +plus+: Private constants
Constant, +quote+: Private constants
Constant, +right-brace+: Private constants
Constant, +right-bracket+: Private constants
Constant, +space+: Private constants
Constant, +t-char+: Private constants
Constant, +tab+: Private constants
Constant, +u+: Private constants

S
Special Variable, *git-path*: Private special variables
Special Variable, *json-test-repo*: Private special variables
Special Variable, *verbose-mode*: Private special variables