The cl-json-helper Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-json-helper Reference Manual

This is the cl-json-helper Reference Manual, version 1.0.0, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 08:07:31 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

###cl-json-helper: A Common Lisp library to assist cl-json.

cl-json encodes and decodes JSON data. cl-json-helper adds two functions to help encoding JSON data and one function to help in processing decoded JSON data.

The nickname xjson can be used for the cl-json-helper package.

[Function]
json-empty ()

	The return value is decoded by cl-json as {}.
	
	Example:
		(cl-json:encode-json-to-string `(("Empty" . ,(xjson:json-empty))))
	=> "{\"Empty\":{}}"

[Function]
json-bool (val)

	Encodes val as "true" or "false"

	Examples:
		(cl-json:encode-json-to-string `(("TRUE" . ,(xjson:json-bool t))))
	=> "{\"TRUE\":true}"
		(cl-json:encode-json-to-string `(("FALSE" . ,(xjson:json-bool nil))))
	=> "{\"FALSE\":false}"

[Function]
json-key-value (key list &key (test #'eql))

	Return the value associated with _key_ in a decoded JSON list, if present, and whether
	or not _key_ was found.
	
	(cl-json:encode-json-to-string '(("HELLO" . "WORLD")
	                                 ("ITS" . "ME")
	                                 ("CEST" . "MOI")))
	=> "{\"HELLO\":\"WORLD\",\"ITS\":\"ME\",\"CEST\":\"MOI\"}"
	
	(cl-json:decode-json-from-string "{\"HELLO\":\"WORLD\",\"ITS\":\"ME\",\"CEST\":\"MOI\"}")
	=> ((:+HELLO+ . "WORLD") (:+ITS+ . "ME") (:+CEST+ . "MOI"))
	
	(xjson:json-key-value :+CEST+ '((:+HELLO+ . "WORLD") (:+ITS+ . "ME") (:+CEST+ . "MOI")))
	=> "MOI"
	   T
	
	(xjson:json-key-value :+FALSE+ (cl-json:decode-json-from-string "{\"FALSE\":false}"))
	=> NIL
	   T
	
	(xjson:json-key-value :+BAR+ (cl-json:decode-json-from-string "{\"FALSE\":false}"))
	=> NIL
	   NIL

json-key-value is just a glorified call to Lisp's assoc

Repository

https://github.com/stablecross/cl-json-helper

####License cl-json-helper is available under a BSD-like license. See the file LICENSE for details.

Contact

For any questions or comments, please feel free to email me, Bob Felts wrf3@stablecross.com


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

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


Previous: , Up: Systems   [Contents][Index]

2.1 cl-json-helper

Author

Bob Felts <wrf3@stablecross.com>

License

BSD

Description

Handy extras for cl-json

Version

1.0.0

Dependency

cl-json

Source

cl-json-helper.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

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


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 cl-json-helper.asd

Location

cl-json-helper.asd

Systems

cl-json-helper (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 cl-json-helper/package.lisp

Parent

cl-json-helper (system)

Location

package.lisp

Packages

cl-json-helper


Previous: , Up: Lisp files   [Contents][Index]

3.1.3 cl-json-helper/cl-json-helper.lisp

Dependency

package.lisp (file)

Parent

cl-json-helper (system)

Location

cl-json-helper.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 cl-json-helper

Source

package.lisp (file)

Nickname

xjson

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: json-bool VAL
Package

cl-json-helper

Source

cl-json-helper.lisp (file)

Function: json-empty ()
Package

cl-json-helper

Source

cl-json-helper.lisp (file)

Function: json-key-value KEY LIST &key TEST
Package

cl-json-helper

Source

cl-json-helper.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *json-empty-obj*
Package

cl-json-helper

Source

cl-json-helper.lisp (file)

Special Variable: *json-false-obj*
Package

cl-json-helper

Source

cl-json-helper.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Classes

Class: json-empty-obj ()
Package

cl-json-helper

Source

cl-json-helper.lisp (file)

Direct superclasses

standard-object (class)

Class: json-false-obj ()
Package

cl-json-helper

Source

cl-json-helper.lisp (file)

Direct superclasses

standard-object (class)

Direct methods

encode-json (method)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cl-json-helper.asd: The cl-json-helper<dot>asd file
cl-json-helper/cl-json-helper.lisp: The cl-json-helper/cl-json-helper<dot>lisp file
cl-json-helper/package.lisp: The cl-json-helper/package<dot>lisp file

F
File, Lisp, cl-json-helper.asd: The cl-json-helper<dot>asd file
File, Lisp, cl-json-helper/cl-json-helper.lisp: The cl-json-helper/cl-json-helper<dot>lisp file
File, Lisp, cl-json-helper/package.lisp: The cl-json-helper/package<dot>lisp file

L
Lisp File, cl-json-helper.asd: The cl-json-helper<dot>asd file
Lisp File, cl-json-helper/cl-json-helper.lisp: The cl-json-helper/cl-json-helper<dot>lisp file
Lisp File, cl-json-helper/package.lisp: The cl-json-helper/package<dot>lisp file

Jump to:   C   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   F   J  
Index Entry  Section

F
Function, json-bool: Exported functions
Function, json-empty: Exported functions
Function, json-key-value: Exported functions

J
json-bool: Exported functions
json-empty: Exported functions
json-key-value: Exported functions

Jump to:   F   J  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*json-empty-obj*: Internal special variables
*json-false-obj*: Internal special variables

S
Special Variable, *json-empty-obj*: Internal special variables
Special Variable, *json-false-obj*: Internal special variables

Jump to:   *  
S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   J   P   S  
Index Entry  Section

C
cl-json-helper: The cl-json-helper system
cl-json-helper: The cl-json-helper package
Class, json-empty-obj: Internal classes
Class, json-false-obj: Internal classes

J
json-empty-obj: Internal classes
json-false-obj: Internal classes

P
Package, cl-json-helper: The cl-json-helper package

S
System, cl-json-helper: The cl-json-helper system

Jump to:   C   J   P   S