The cl-apple-plist Reference Manual

Table of Contents

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

The cl-apple-plist Reference Manual

This is the cl-apple-plist Reference Manual, version 0.1, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 03:07:30 2018 GMT+0.


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

1 Introduction

cl-apple-plist

Encodes Common Lisp data structures in Apple property list XML format (.plist).

Released under a BSD style license.

Introduction

When building Apple IOS applications, it's convenient to use .plist files to store reference data.

About Property Lists

Rather than maintain plist files by hand or using Xcode, I've found it useful to create Lisp data structures as s-expressions and then use this library to export to .plist files.

Notes

Lists are encoded as array tags, number as integer or real and t and nil map to true and false respectively.

CL-USER> (encode-apple-plist (list "hello" "world" 1 2.89 t nil))
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<string>hello</string>
<string>world</string>
<integer>1</integer>
<real>2.89</real>
<true/>
<false/>
</array>
</plist>
NIL

Hash tables become dict tags.

 CL-USER> (let ((h (make-hash-table))) (setf (gethash 1 h) "one") (encode-apple-plist h))
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
 <key>1</key><string>one</string>
 </dict>
 </plist>
 NIL

encode-apple-plist takes an optional stream argument, but encode-apple-plist-to-file(data filename) is a convenenience function that writes the plist to a file.

CL-USER> (encode-apple-plist-to-file ((list "1" "2") "myfile.plist"))

Strings are HTML-encoded using the html-encode library.

There is currently no support for date tags, partly because Lisp dates are stored as integers rather than arecognizable date type. Ideas welcome.

There is currently no support for data tags. Ideas welcome.

Should BITs be mapped to true and false or 0 and 1?

Rob Blackwell

October 2011


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-apple-plist

Author

Rob Blackwell

Description

Encodes Common Lisp data structures in Apple property list XML format (.plist).

Version

0.1

Dependency

html-encode

Source

cl-apple-plist.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-apple-plist.asd

Location

cl-apple-plist.asd

Systems

cl-apple-plist (system)


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

3.1.2 cl-apple-plist/package.lisp

Parent

cl-apple-plist (system)

Location

package.lisp

Packages

cl-apple-plist


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

3.1.3 cl-apple-plist/plist.lisp

Dependency

package.lisp (file)

Parent

cl-apple-plist (system)

Location

plist.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-apple-plist

Source

package.lisp (file)

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: encode-apple-plist OBJECT &optional STREAM

Encodes the given data structure in Apple plist XML format

Package

cl-apple-plist

Source

plist.lisp (file)

Function: encode-apple-plist-to-file OBJECT FILENAME

Encodes the given data structure in Apple plist XML format which is written to the given file

Package

cl-apple-plist

Source

plist.lisp (file)


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

5.2 Internal definitions


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

5.2.1 Generic functions

Generic Function: encode-apple-plist-node OBJECT &optional STREAM

Encodes the given object as a plist XML node

Package

cl-apple-plist

Source

plist.lisp (file)

Methods
Method: encode-apple-plist-node (SELF hash-table) &optional STREAM

Encodes a hastable as a dict node in plist format

Method: encode-apple-plist-node (SELF (eql nil)) &optional STREAM

Encodes nil as a false node in plist format

Method: encode-apple-plist-node (SELF (eql t)) &optional STREAM

Encodes t as a true node in plist format

Method: encode-apple-plist-node (SELF float) &optional STREAM

Encodes a float in plist format

Method: encode-apple-plist-node (SELF integer) &optional STREAM

Encodes an integer in plist format

Method: encode-apple-plist-node (SELF string) &optional STREAM

Encodes a string in plist format

Method: encode-apple-plist-node (SELF vector) &optional STREAM

Encodes a vector as an array node in plist format

Method: encode-apple-plist-node (SELF cons) &optional STREAM

Encodes a list as an array node in plist format


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-apple-plist.asd: The cl-apple-plist<dot>asd file
cl-apple-plist/package.lisp: The cl-apple-plist/package<dot>lisp file
cl-apple-plist/plist.lisp: The cl-apple-plist/plist<dot>lisp file

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

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

Jump to:   C   F   L  

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

A.2 Functions

Jump to:   E   F   G   M  
Index Entry  Section

E
encode-apple-plist: Exported functions
encode-apple-plist-node: Internal generic functions
encode-apple-plist-node: Internal generic functions
encode-apple-plist-node: Internal generic functions
encode-apple-plist-node: Internal generic functions
encode-apple-plist-node: Internal generic functions
encode-apple-plist-node: Internal generic functions
encode-apple-plist-node: Internal generic functions
encode-apple-plist-node: Internal generic functions
encode-apple-plist-node: Internal generic functions
encode-apple-plist-to-file: Exported functions

F
Function, encode-apple-plist: Exported functions
Function, encode-apple-plist-to-file: Exported functions

G
Generic Function, encode-apple-plist-node: Internal generic functions

M
Method, encode-apple-plist-node: Internal generic functions
Method, encode-apple-plist-node: Internal generic functions
Method, encode-apple-plist-node: Internal generic functions
Method, encode-apple-plist-node: Internal generic functions
Method, encode-apple-plist-node: Internal generic functions
Method, encode-apple-plist-node: Internal generic functions
Method, encode-apple-plist-node: Internal generic functions
Method, encode-apple-plist-node: Internal generic functions

Jump to:   E   F   G   M  

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

A.3 Variables


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

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cl-apple-plist: The cl-apple-plist system
cl-apple-plist: The cl-apple-plist package

P
Package, cl-apple-plist: The cl-apple-plist package

S
System, cl-apple-plist: The cl-apple-plist system

Jump to:   C   P   S