The simple-config Reference Manual

Table of Contents

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

The simple-config Reference Manual

This is the simple-config Reference Manual, version 1.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Fri Jun 26 12:14:04 2020 GMT+0.


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

1 Introduction

simple-config

ava fox

a library to load and parse simple config files of the format KEY = VALUE

attempts to parse each value into its proper lisp data type.

config example:

env = development
program-version=2
aws_bucket = config-bucket

Install

(ql:quickload :simple-config)

API

load-config - file-path &key parse-lists list-separator

Loads a config file from FILE-PATH

if PARSE-LISTS is non-nil VALUES are checked for LIST-SEPARATOR and split by it.

PARSE-LISTS defaults to t

LIST-SEPARATOR defaults to #\,

Returns t if successfully loaded, otherwise nil


config - key &optional default

Checks loaded config for KEY, returning nil if not found

If DEFAULT is given, returns it instead of nil if KEY isn't found


save-config - file-path

writes the currently loaded config to FILE-PATH, overwriting it if it already exists


License

BSD 3-Clause


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 simple-config

Author

ava fox <dev@computerfox.xyz>

License

BSD 3-Clause

Description

loads and parses a KEY=VALUE style config file

Version

1.0

Dependencies
Source

simple-config.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 simple-config.asd

Location

simple-config.asd

Systems

simple-config (system)


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

3.1.2 simple-config/package.lisp

Parent

simple-config (system)

Location

package.lisp

Packages

simple-config


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

3.1.3 simple-config/simple-config.lisp

Dependency

package.lisp (file)

Parent

simple-config (system)

Location

simple-config.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 simple-config

Source

package.lisp (file)

Nickname

conf

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


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

5.1.1 Functions

Function: config KEY &optional DEFAULT

retrieve the value from config using KEY, returns nil if not found

if DEFAULT is given returns it instead of nil when KEY is not found

Package

simple-config

Source

simple-config.lisp (file)

Writer

(setf config) (generic function)

Function: load-config FILE-PATH &key PARSE-LISTS LIST-SEPARATOR

loads config at FILE-PATH

PARSE-LISTS defaults to t
LIST-SEPARATOR defaults to #,

if PARSE-LISTS is non-nil we check any value for character LIST-SEPARATOR and split it by that

returns T on success, NIL otherwise

Package

simple-config

Source

simple-config.lisp (file)

Function: save-config FILE-PATH

saves currently loaded config to FILEPATH

Package

simple-config

Source

simple-config.lisp (file)


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

5.1.2 Generic functions

Generic Function: (setf config) VALUE KEY
Package

simple-config

Reader

config (function)

Methods
Method: (setf config) VALUE KEY

allows us to do setf on (config) calls

Source

simple-config.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: *config*

our loaded config

Package

simple-config

Source

simple-config.lisp (file)

Special Variable: *list-separator*
Package

simple-config

Source

simple-config.lisp (file)

Special Variable: *parse-lists*
Package

simple-config

Source

simple-config.lisp (file)


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

5.2.2 Functions

Function: line-comment-p LINE

checks if LINE is a full line comments

Package

simple-config

Source

simple-config.lisp (file)

Function: parse-value VALUE

determines what kind of data VALUE is, and parses it correctly

Package

simple-config

Source

simple-config.lisp (file)

Function: print-config STREAM DATA &optional COLONP ATSIGNP

custom format function that prints out config

Package

simple-config

Source

simple-config.lisp (file)

Function: string-to-keyword STR

converts STR into a keyword

replaces all underscores with hyphens

Package

simple-config

Source

simple-config.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   S  
Index Entry  Section

F
File, Lisp, simple-config.asd: The simple-config․asd file
File, Lisp, simple-config/package.lisp: The simple-config/package․lisp file
File, Lisp, simple-config/simple-config.lisp: The simple-config/simple-config․lisp file

L
Lisp File, simple-config.asd: The simple-config․asd file
Lisp File, simple-config/package.lisp: The simple-config/package․lisp file
Lisp File, simple-config/simple-config.lisp: The simple-config/simple-config․lisp file

S
simple-config.asd: The simple-config․asd file
simple-config/package.lisp: The simple-config/package․lisp file
simple-config/simple-config.lisp: The simple-config/simple-config․lisp file

Jump to:   F   L   S  

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

A.2 Functions

Jump to:   (  
C   F   G   L   M   P   S  
Index Entry  Section

(
(setf config): Exported generic functions
(setf config): Exported generic functions

C
config: Exported functions

F
Function, config: Exported functions
Function, line-comment-p: Internal functions
Function, load-config: Exported functions
Function, parse-value: Internal functions
Function, print-config: Internal functions
Function, save-config: Exported functions
Function, string-to-keyword: Internal functions

G
Generic Function, (setf config): Exported generic functions

L
line-comment-p: Internal functions
load-config: Exported functions

M
Method, (setf config): Exported generic functions

P
parse-value: Internal functions
print-config: Internal functions

S
save-config: Exported functions
string-to-keyword: Internal functions

Jump to:   (  
C   F   G   L   M   P   S  

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

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*config*: Internal special variables
*list-separator*: Internal special variables
*parse-lists*: Internal special variables

S
Special Variable, *config*: Internal special variables
Special Variable, *list-separator*: Internal special variables
Special Variable, *parse-lists*: Internal special variables

Jump to:   *  
S  

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

A.4 Data types

Jump to:   P   S  
Index Entry  Section

P
Package, simple-config: The simple-config package

S
simple-config: The simple-config system
simple-config: The simple-config package
System, simple-config: The simple-config system

Jump to:   P   S