The cl-csv Reference Manual

This is the cl-csv Reference Manual, version 1.0.6, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 03:51:55 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 cl-csv

Facilities for reading and writing CSV format files

Author

<>

License

BSD

Version

1.0.6

Dependencies
  • iterate (system).
  • alexandria (system).
  • cl-interpol (system).
Source

cl-csv.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 cl-csv/cl-csv.asd

Source

cl-csv.asd.

Parent Component

cl-csv (system).

ASDF Systems

cl-csv.

Packages

cl-csv.system.


3.1.2 cl-csv/packages.lisp

Source

cl-csv.asd.

Parent Component

cl-csv (system).

Packages

cl-csv.


3.1.3 cl-csv/vars.lisp

Dependency

packages.lisp (file).

Source

cl-csv.asd.

Parent Component

cl-csv (system).

Public Interface
Internals

3.1.4 cl-csv/read-until.lisp

Dependency

vars.lisp (file).

Source

cl-csv.asd.

Parent Component

cl-csv (system).

Internals

read-into-buffer-until (function).


3.1.5 cl-csv/csv.lisp

Dependency

read-until.lisp (file).

Source

cl-csv.asd.

Parent Component

cl-csv (system).

Public Interface
Internals

3.1.6 cl-csv/parser.lisp

Dependency

csv.lisp (file).

Source

cl-csv.asd.

Parent Component

cl-csv (system).

Public Interface

print-object (method).

Internals

4 Packages

Packages are listed by definition order.


4.1 cl-csv

Source

packages.lisp.

Use List
  • common-lisp.
  • common-lisp-user.
  • iterate.
Public Interface
Internals

4.2 cl-csv.system

Source

cl-csv.asd.

Use List
  • asdf/interface.
  • common-lisp.

5 Definitions

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


5.1 Public Interface


5.1.1 Special variables

Special Variable: *default-external-format*

the external format used for opening files

Package

cl-csv.

Source

csv.lisp.

Special Variable: *enable-signals*

Should the reading and writing process enable filtering signals

Package

cl-csv.

Source

vars.lisp.

Special Variable: *quote*

Default quote character

Package

cl-csv.

Source

vars.lisp.

Special Variable: *quote-escape*

Default setting for escaping quotes - by default this is a vector of #(*quote* *quote*)

Package

cl-csv.

Source

vars.lisp.

Special Variable: *separator*

Default separator character

Package

cl-csv.

Source

vars.lisp.


5.1.2 Macros

Macro: do-csv ((row-var stream-or-pathname &rest read-csv-keys) &body body)

row-var: a variable that is passed into _body_

stream-or-pathname: a stream or a pathname to read the CSV data from

read-csv-keys: keys and values passed to the _read-csv_ function

body: body of the macro

Package

cl-csv.

Source

csv.lisp.


5.1.3 Ordinary functions

Function: csv-data-read (data &key csv-reader)
Package

cl-csv.

Source

csv.lisp.

Function: csv-parse-error (msg &rest args)
Package

cl-csv.

Source

csv.lisp.

Function: csv-row-read (row &key csv-reader)
Package

cl-csv.

Source

csv.lisp.

Function: read-csv (stream-or-string &rest all-keys &key csv-reader row-fn map-fn data-map-fn sample skip-first-p separator quote escape unquoted-empty-string-is-nil quoted-empty-string-is-nil trim-outer-whitespace newline escape-mode)
Package

cl-csv.

Source

csv.lisp.

Function: read-csv-row (stream-or-string &key csv-reader separator quote escape unquoted-empty-string-is-nil quoted-empty-string-is-nil trim-outer-whitespace newline escape-mode)
Package

cl-csv.

Source

csv.lisp.

Function: read-csv-sample (stream-or-string sample-size &key row-fn map-fn skip-first-p separator quote escape unquoted-empty-string-is-nil quoted-empty-string-is-nil trim-outer-whitespace newline)
Package

cl-csv.

Source

csv.lisp.

Function: write-csv (rows-of-items &key stream separator quote escape newline always-quote)

Writes a csv to the given stream.

rows-of-items: iterable

Keywords:
stream: stream to write to. Default: nil.
nil - writes the rows to a string and returns it an open stream
a pathname (overwrites if the file exists)
quote: quoting character. Defaults to *quote* escape: escaping character. Defaults to *quote-escape* newline: newline character. Defaults to *write-newline* always-quote: Defaults to *always-quote*

Package

cl-csv.

Source

csv.lisp.

Function: write-csv-row (items &key stream separator quote escape newline always-quote)

Writes a list items to stream

rows-of-items: iterable

Keywords:

stream: stream to write to. Default: nil.

quote: quoting character. Defaults to *quote*

escape: escaping character. Defaults to *quote-escape*

newline: newline character. Defaults to *write-newline*

always-quote: Defaults to *always-quote*

Package

cl-csv.

Source

csv.lisp.


5.1.4 Generic functions

Generic Reader: data (condition)
Generic Writer: (setf data) (condition)
Package

cl-csv.

Methods
Reader Method: data ((condition csv-data-read))
Writer Method: (setf data) ((condition csv-data-read))
Source

csv.lisp.

Target Slot

data.

Generic Function: format-csv-value (val)

Print values in ways that are most cross compatible with the csv format

Package

cl-csv.

Source

csv.lisp.

Methods
Method: format-csv-value (val)
Generic Reader: row (condition)
Generic Writer: (setf row) (condition)
Package

cl-csv.

Methods
Reader Method: row ((condition csv-row-read))
Writer Method: (setf row) ((condition csv-row-read))
Source

csv.lisp.

Target Slot

row.

Generic Function: write-csv-value (val csv-stream &key formatter quote separator escape always-quote newline)

Writes val to csv-stream in a formatted fashion.

Keywords

formatter: used to format val. Defaults to format-csv-value.

quote: quoting character. Defaults to *quote*

escape: escaping character. Defaults to *quote-escape*

newline: newline character. Defaults to *write-newline*

always-quote: Defaults to *always-quote*

Package

cl-csv.

Source

csv.lisp.

Methods
Method: write-csv-value (val csv-stream &key formatter quote separator escape always-quote newline)

5.1.5 Standalone methods

Method: print-object ((o read-dispatch-table) s)

Print the auto-print-items for this instance.

Source

parser.lisp.


5.1.6 Conditions

Condition: csv-data-read
Package

cl-csv.

Source

csv.lisp.

Direct superclasses

condition.

Direct methods
Direct slots
Slot: data
Initform

(quote nil)

Initargs

:data

Readers

data.

Writers

(setf data).

Slot: csv-reader
Initform

(quote nil)

Initargs

:csv-reader

Readers

csv-reader.

Writers

(setf csv-reader).

Condition: csv-parse-error
Package

cl-csv.

Source

csv.lisp.

Direct superclasses

error.

Direct methods
Direct slots
Slot: format-control
Initform

(quote nil)

Initargs

:format-control

Readers

format-control.

Writers

(setf format-control).

Slot: format-args
Initform

(quote nil)

Initargs

:format-args

Readers

format-args.

Writers

(setf format-args).

Condition: csv-row-read
Package

cl-csv.

Source

csv.lisp.

Direct superclasses

condition.

Direct methods
Direct slots
Slot: row
Initform

(quote nil)

Initargs

:row

Readers

row.

Writers

(setf row).

Slot: csv-reader
Initform

(quote nil)

Initargs

:csv-reader

Readers

csv-reader.

Writers

(setf csv-reader).


5.2 Internals


5.2.1 Special variables

Special Variable: *always-quote*

Default setting for always quoting

Package

cl-csv.

Source

vars.lisp.

Special Variable: *buffer-size*
Package

cl-csv.

Source

vars.lisp.

Special Variable: *eof-char*

The char we use for eof

Package

cl-csv.

Source

vars.lisp.

Special Variable: *escape-mode*

Controls how escapes are handled.
:quote - replace the entire *quote-escape* sequence with the quote character whenever we find it. Commonly used with "" quote escapes

:following - replace the escape character and the following character with just the following character.
EG: (*quote-escape* #\ )
\ ->
r -> r
’ -> ’

Package

cl-csv.

Source

vars.lisp.

Special Variable: *quoted-empty-string-is-nil*

Should empty string values, be nil or "".
Unquoted values are always trimmed of surrounding whitespace. Quoted values are never be trimmed

Package

cl-csv.

Source

vars.lisp.

Special Variable: *read-newline*

Default newline string for reading.
We trim extra whitespace by default *trim-outer-whitespace*

Package

cl-csv.

Source

vars.lisp.

Special Variable: *trim-outer-whitespace*

Should white space between delimiters and data or quotes be removed

These underscores (if they were spaces) are the locations in question ’a’,_b_,_’ c ’_,_d

Package

cl-csv.

Source

vars.lisp.

Special Variable: *unquoted-empty-string-is-nil*

Should unquoted empty string values, be nil or "".

Package

cl-csv.

Source

vars.lisp.

Special Variable: *write-newline*

When writing what should the newline convention be

Package

cl-csv.

Source

vars.lisp.


5.2.2 Macros

Macro: clause-for-in-csv-1 (&key for in-csv skipping-header separator quote escaped-quote)

in-csv driver for iterate

Package

cl-csv.

Source

csv.lisp.

Macro: clause-sampling-2 (&key sampling into size)

resevoir sample the input

Package

cl-csv.

Source

csv.lisp.

Macro: with-csv-input-stream ((name inp) &body body)
Package

cl-csv.

Source

csv.lisp.

Macro: with-csv-output-stream ((name inp) &body body)
Package

cl-csv.

Source

csv.lisp.


5.2.3 Ordinary functions

Function: %char-in (c to-check)
Package

cl-csv.

Source

csv.lisp.

Function: %escape-is-double-quote ()
Package

cl-csv.

Source

parser.lisp.

Function: %escape-seq? (s i escape llen elen)
Package

cl-csv.

Source

csv.lisp.

Function: %in-stream (stream-or-string)
Package

cl-csv.

Source

csv.lisp.

Function: %next-char (reader)
Package

cl-csv.

Source

parser.lisp.

Function: %out-stream (stream-or-string)

creates a stream from the given thing, trying to DWIM

Package

cl-csv.

Source

csv.lisp.

Function: %trim-datum (csv-reader)
Package

cl-csv.

Source

parser.lisp.

Function: chars-in (chars-to-check value-to-look-through)

returns true if any of the chars-to-check is found in the value-to-look-through

Package

cl-csv.

Source

csv.lisp.

Function: check-and-distpatch (table c)

Check all the entries in a read-dispatch-table to find a match
if it matches, call the function with the table character and entry

Package

cl-csv.

Source

parser.lisp.

Function: collect-datum (csv-reader)
Package

cl-csv.

Source

parser.lisp.

Function: collect-row-data (csv-reader)
Package

cl-csv.

Source

parser.lisp.

Function: drop-delimiter-chars (table entry)

This backs up the buffer till the delimiter is not in it
we call this without having adding the character we just got that dispatched

Package

cl-csv.

Source

parser.lisp.

Function: last-item (buff &key n)
Package

cl-csv.

Source

parser.lisp.

Function: (setf last-item) (buff)
Package

cl-csv.

Source

parser.lisp.

Function: make-default-csv-reader ()

Creates the default csv dispatch table
This can usually be fully changed simply by tweaking the special variables
defined in vars. You will need to reinstantiate this object when you change those variables (which is what happens by default)

Package

cl-csv.

Source

parser.lisp.

Function: make-table-entry (delimiter dispatch &key class)

Creates a table entry ensuring everything has the correct types and values

Package

cl-csv.

Source

parser.lisp.

Function: map-empty-string-to-nil (data &key csv-reader &allow-other-keys)
Package

cl-csv.

Source

parser.lisp.

Function: read-csv-row-with-reader (stream-or-string &key csv-reader map-fn data-map-fn &allow-other-keys)

Read a row of csv from the input

Package

cl-csv.

Source

parser.lisp.

Function: read-csv-with-reader (stream-or-string &key csv-reader row-fn map-fn data-map-fn skip-first-p &allow-other-keys)

Read a whole csv from the input

Package

cl-csv.

Source

parser.lisp.

Function: read-into-buffer-until (buffer stream &key nl nl-match)

This reads into a buffer until either the buffer is full or the
we have read the newline character(s).

If we read the newline characters they will be the last character(s) in the buffer

Package

cl-csv.

Source

read-until.lisp.

Function: read-with-dispatch-table (table stream)

A generic function for processing all the characters of a stream until a match arises and collecting that data as it goes

Package

cl-csv.

Source

parser.lisp.

Function: reading-character (csv-reader c &key table-entry)

We read a random character that was not otherwise dispatched on

Package

cl-csv.

Source

parser.lisp.

Function: reset-table-entry (te)

resets the entry state when it doesnt match

Package

cl-csv.

Source

parser.lisp.

Function: restartable-read-row (stream csv-reader)
Package

cl-csv.

Source

csv.lisp.

Function: white-space? (c)
Package

cl-csv.

Source

csv.lisp.


5.2.4 Generic functions

Generic Reader: after-quoted? (object)
Package

cl-csv.

Methods
Reader Method: after-quoted? ((csv-reader csv-reader))

automatically generated reader method

Source

parser.lisp.

Target Slot

after-quoted?.

Generic Writer: (setf after-quoted?) (object)
Package

cl-csv.

Methods
Writer Method: (setf after-quoted?) ((csv-reader csv-reader))

automatically generated writer method

Source

parser.lisp.

Target Slot

after-quoted?.

Generic Reader: buffer (object)
Package

cl-csv.

Methods
Reader Method: buffer ((read-dispatch-table read-dispatch-table))

automatically generated reader method

Source

parser.lisp.

Target Slot

buffer.

Generic Writer: (setf buffer) (object)
Package

cl-csv.

Methods
Writer Method: (setf buffer) ((read-dispatch-table read-dispatch-table))

automatically generated writer method

Source

parser.lisp.

Target Slot

buffer.

Generic Reader: character-idx (object)
Package

cl-csv.

Methods
Reader Method: character-idx ((read-dispatch-table read-dispatch-table))

automatically generated reader method

Source

parser.lisp.

Target Slot

character-idx.

Generic Writer: (setf character-idx) (object)
Package

cl-csv.

Methods
Writer Method: (setf character-idx) ((read-dispatch-table read-dispatch-table))

automatically generated writer method

Source

parser.lisp.

Target Slot

character-idx.

Generic Reader: character-line-idx (object)
Package

cl-csv.

Methods
Reader Method: character-line-idx ((read-dispatch-table read-dispatch-table))

automatically generated reader method

Source

parser.lisp.

Target Slot

character-line-idx.

Generic Writer: (setf character-line-idx) (object)
Package

cl-csv.

Methods
Writer Method: (setf character-line-idx) ((read-dispatch-table read-dispatch-table))

automatically generated writer method

Source

parser.lisp.

Target Slot

character-line-idx.

Generic Function: check-table-entry (table entry c)
Package

cl-csv.

Methods
Method: check-table-entry (table entry c)

Given the next character in a stream check if the table entry matches reset if it matches fully or doesnt match

Source

parser.lisp.

Generic Reader: csv-reader (condition)
Generic Writer: (setf csv-reader) (condition)
Package

cl-csv.

Methods
Reader Method: csv-reader ((condition csv-row-read))
Writer Method: (setf csv-reader) ((condition csv-row-read))
Source

csv.lisp.

Target Slot

csv-reader.

Reader Method: csv-reader ((condition csv-data-read))
Writer Method: (setf csv-reader) ((condition csv-data-read))
Source

csv.lisp.

Target Slot

csv-reader.

Generic Reader: data-map-fn (object)
Package

cl-csv.

Methods
Reader Method: data-map-fn ((csv-reader csv-reader))

automatically generated reader method

Source

parser.lisp.

Target Slot

data-map-fn.

Generic Writer: (setf data-map-fn) (object)
Package

cl-csv.

Methods
Writer Method: (setf data-map-fn) ((csv-reader csv-reader))

automatically generated writer method

Source

parser.lisp.

Target Slot

data-map-fn.

Generic Reader: delimiter (object)
Package

cl-csv.

Methods
Reader Method: delimiter ((read-dispatch-table-entry read-dispatch-table-entry))

automatically generated reader method

Source

parser.lisp.

Target Slot

delimiter.

Generic Writer: (setf delimiter) (object)
Package

cl-csv.

Methods
Writer Method: (setf delimiter) ((read-dispatch-table-entry read-dispatch-table-entry))

automatically generated writer method

Source

parser.lisp.

Target Slot

delimiter.

Generic Reader: didx (object)
Package

cl-csv.

Methods
Reader Method: didx ((read-dispatch-table-entry read-dispatch-table-entry))

automatically generated reader method

Source

parser.lisp.

Target Slot

didx.

Generic Writer: (setf didx) (object)
Package

cl-csv.

Methods
Writer Method: (setf didx) ((read-dispatch-table-entry read-dispatch-table-entry))

automatically generated writer method

Source

parser.lisp.

Target Slot

didx.

Generic Reader: dispatch (object)
Package

cl-csv.

Methods
Reader Method: dispatch ((read-dispatch-table-entry read-dispatch-table-entry))

automatically generated reader method

Source

parser.lisp.

Target Slot

dispatch.

Generic Writer: (setf dispatch) (object)
Package

cl-csv.

Methods
Writer Method: (setf dispatch) ((read-dispatch-table-entry read-dispatch-table-entry))

automatically generated writer method

Source

parser.lisp.

Target Slot

dispatch.

Generic Reader: dlen (object)
Package

cl-csv.

Methods
Reader Method: dlen ((read-dispatch-table-entry read-dispatch-table-entry))

automatically generated reader method

Source

parser.lisp.

Target Slot

dlen.

Generic Writer: (setf dlen) (object)
Package

cl-csv.

Methods
Writer Method: (setf dlen) ((read-dispatch-table-entry read-dispatch-table-entry))

automatically generated writer method

Source

parser.lisp.

Target Slot

dlen.

Generic Reader: dlen-1 (object)
Package

cl-csv.

Methods
Reader Method: dlen-1 ((read-dispatch-table-entry read-dispatch-table-entry))

automatically generated reader method

Source

parser.lisp.

Target Slot

dlen-1.

Generic Writer: (setf dlen-1) (object)
Package

cl-csv.

Methods
Writer Method: (setf dlen-1) ((read-dispatch-table-entry read-dispatch-table-entry))

automatically generated writer method

Source

parser.lisp.

Target Slot

dlen-1.

Generic Reader: entries (object)
Package

cl-csv.

Methods
Reader Method: entries ((read-dispatch-table read-dispatch-table))

automatically generated reader method

Source

parser.lisp.

Target Slot

entries.

Generic Writer: (setf entries) (object)
Package

cl-csv.

Methods
Writer Method: (setf entries) ((read-dispatch-table read-dispatch-table))

automatically generated writer method

Source

parser.lisp.

Target Slot

entries.

Generic Reader: format-args (condition)
Generic Writer: (setf format-args) (condition)
Package

cl-csv.

Methods
Reader Method: format-args ((condition csv-parse-error))
Writer Method: (setf format-args) ((condition csv-parse-error))
Source

csv.lisp.

Target Slot

format-args.

Generic Reader: format-control (condition)
Generic Writer: (setf format-control) (condition)
Package

cl-csv.

Methods
Reader Method: format-control ((condition csv-parse-error))
Writer Method: (setf format-control) ((condition csv-parse-error))
Source

csv.lisp.

Target Slot

format-control.

Generic Reader: line-data (object)
Package

cl-csv.

Methods
Reader Method: line-data ((csv-reader csv-reader))

automatically generated reader method

Source

parser.lisp.

Target Slot

line-data.

Generic Writer: (setf line-data) (object)
Package

cl-csv.

Methods
Writer Method: (setf line-data) ((csv-reader csv-reader))

automatically generated writer method

Source

parser.lisp.

Target Slot

line-data.

Generic Reader: line-idx (object)
Package

cl-csv.

Methods
Reader Method: line-idx ((read-dispatch-table read-dispatch-table))

automatically generated reader method

Source

parser.lisp.

Target Slot

line-idx.

Generic Writer: (setf line-idx) (object)
Package

cl-csv.

Methods
Writer Method: (setf line-idx) ((read-dispatch-table read-dispatch-table))

automatically generated writer method

Source

parser.lisp.

Target Slot

line-idx.

Generic Reader: map-fn (object)
Package

cl-csv.

Methods
Reader Method: map-fn ((csv-reader csv-reader))

automatically generated reader method

Source

parser.lisp.

Target Slot

map-fn.

Generic Writer: (setf map-fn) (object)
Package

cl-csv.

Methods
Writer Method: (setf map-fn) ((csv-reader csv-reader))

automatically generated writer method

Source

parser.lisp.

Target Slot

map-fn.

Generic Reader: parse-stream (object)
Package

cl-csv.

Methods
Reader Method: parse-stream ((read-dispatch-table read-dispatch-table))

automatically generated reader method

Source

parser.lisp.

Target Slot

parse-stream.

Generic Writer: (setf parse-stream) (object)
Package

cl-csv.

Methods
Writer Method: (setf parse-stream) ((read-dispatch-table read-dispatch-table))

automatically generated writer method

Source

parser.lisp.

Target Slot

parse-stream.

Generic Function: reading-escaped (csv-reader c &key table-entry)
Package

cl-csv.

Methods
Method: reading-escaped (csv-reader c &key table-entry)

We read an escape sequence and need to handle storing the escaped character

Source

parser.lisp.

Generic Function: reading-following-escaped (csv-reader c &key table-entry)
Package

cl-csv.

Methods
Method: reading-following-escaped (csv-reader c &key table-entry)

We read an escape sequence and need to handle storing the escaped character

Source

parser.lisp.

Generic Function: reading-newline (csv-reader c &key table-entry)
Package

cl-csv.

Methods
Method: reading-newline (csv-reader c &key table-entry)

We got the newline character which will be handled differently based on if we are in quoted data or not

Source

parser.lisp.

Generic Function: reading-quoted (csv-reader c &key table-entry)
Package

cl-csv.

Methods
Method: reading-quoted (csv-reader c &key table-entry)

Method to handle reading a quote
NB: this interacts wierdly with escape-mode :quote

Source

parser.lisp.

Generic Function: reading-quoted-or-escaped (csv-reader c &key table-entry)
Package

cl-csv.

Methods
Method: reading-quoted-or-escaped (csv-reader c &key table-entry)

Method to handle reading a quote or a pair of quotes

Source

parser.lisp.

Generic Reader: reading-quoted? (object)
Package

cl-csv.

Methods
Reader Method: reading-quoted? ((csv-reader csv-reader))

automatically generated reader method

Source

parser.lisp.

Target Slot

reading-quoted?.

Generic Writer: (setf reading-quoted?) (object)
Package

cl-csv.

Methods
Writer Method: (setf reading-quoted?) ((csv-reader csv-reader))

automatically generated writer method

Source

parser.lisp.

Target Slot

reading-quoted?.

Generic Function: reading-separator (csv-reader c &key table-entry)
Package

cl-csv.

Methods
Method: reading-separator (csv-reader c &key table-entry)

We got the data separator character which will be handled differently based on if we are in quoted data or not

Source

parser.lisp.

Generic Reader: row-fn (object)
Package

cl-csv.

Methods
Reader Method: row-fn ((csv-reader csv-reader))

automatically generated reader method

Source

parser.lisp.

Target Slot

row-fn.

Generic Writer: (setf row-fn) (object)
Package

cl-csv.

Methods
Writer Method: (setf row-fn) ((csv-reader csv-reader))

automatically generated writer method

Source

parser.lisp.

Target Slot

row-fn.

Generic Reader: rows (object)
Package

cl-csv.

Methods
Reader Method: rows ((csv-reader csv-reader))

automatically generated reader method

Source

parser.lisp.

Target Slot

rows.

Generic Writer: (setf rows) (object)
Package

cl-csv.

Methods
Writer Method: (setf rows) ((csv-reader csv-reader))

automatically generated writer method

Source

parser.lisp.

Target Slot

rows.

Generic Reader: skip-row? (object)
Package

cl-csv.

Methods
Reader Method: skip-row? ((csv-reader csv-reader))

automatically generated reader method

Source

parser.lisp.

Target Slot

skip-row?.

Generic Writer: (setf skip-row?) (object)
Package

cl-csv.

Methods
Writer Method: (setf skip-row?) ((csv-reader csv-reader))

automatically generated writer method

Source

parser.lisp.

Target Slot

skip-row?.


5.2.5 Classes

Class: csv-reader

the state of the csv reader, which is also is a read table

Package

cl-csv.

Source

parser.lisp.

Direct superclasses

read-dispatch-table.

Direct methods
Direct slots
Slot: rows
Initform

(make-array 10 :element-type (quote list) :initial-element nil :adjustable t :fill-pointer 0)

Initargs

cl-csv::rows

Readers

rows.

Writers

(setf rows).

Slot: line-data
Initform

(make-array 10 :element-type (quote string) :initial-element "" :adjustable t :fill-pointer 0)

Readers

line-data.

Writers

(setf line-data).

Slot: reading-quoted?
Readers

reading-quoted?.

Writers

(setf reading-quoted?).

Slot: after-quoted?
Readers

after-quoted?.

Writers

(setf after-quoted?).

Slot: row-fn
Initargs

:row-fn

Readers

row-fn.

Writers

(setf row-fn).

Slot: map-fn
Initargs

:map-fn

Readers

map-fn.

Writers

(setf map-fn).

Slot: data-map-fn
Initform

(quote cl-csv::map-empty-string-to-nil)

Initargs

:data-map-fn

Readers

data-map-fn.

Writers

(setf data-map-fn).

Slot: skip-row?
Initargs

:skip-row?

Readers

skip-row?.

Writers

(setf skip-row?).

Class: read-dispatch-table

A stream parser that collects characters
and when a certain delimiter is matched will call a certain function. These delimiter / function pairs are read-dispatch table entries It contains all the state for the parse process
See: csv-reader

Package

cl-csv.

Source

parser.lisp.

Direct subclasses

csv-reader.

Direct methods
Direct slots
Slot: parse-stream
Initargs

:parse-stream

Readers

parse-stream.

Writers

(setf parse-stream).

Slot: buffer
Initform

(make-array cl-csv::*buffer-size* :element-type (quote character) :initial-element #\nul :adjustable t :fill-pointer 0)

Initargs

:buffer

Readers

buffer.

Writers

(setf buffer).

Slot: entries
Initargs

:entries

Readers

entries.

Writers

(setf entries).

Slot: line-idx
Initform

0

Initargs

:line-idx

Readers

line-idx.

Writers

(setf line-idx).

Slot: character-line-idx
Initform

0

Initargs

:character-line-idx

Readers

character-line-idx.

Writers

(setf character-line-idx).

Slot: character-idx
Initform

0

Initargs

:character-idx

Readers

character-idx.

Writers

(setf character-idx).

Class: read-dispatch-table-entry

When a certain delimiter is matched it will call a certain function T matches anything
create these with make-table-entry

Package

cl-csv.

Source

parser.lisp.

Direct methods
Direct slots
Slot: delimiter
Type

(or (vector (or boolean character)) null)

Initargs

:delimiter

Readers

delimiter.

Writers

(setf delimiter).

Slot: didx
Type

fixnum

Initform

-1

Initargs

:didx

Readers

didx.

Writers

(setf didx).

Slot: dlen
Type

fixnum

Initform

0

Initargs

:dlen

Readers

dlen.

Writers

(setf dlen).

Slot: dlen-1
Type

fixnum

Initform

-1

Initargs

:dlen-1

Readers

dlen-1.

Writers

(setf dlen-1).

Slot: dispatch
Type

(or function null)

Initargs

:dispatch

Readers

dispatch.

Writers

(setf dispatch).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %   (  
A   B   C   D   E   F   G   L   M   P   R   S   W  
Index Entry  Section

%
%char-in: Private ordinary functions
%escape-is-double-quote: Private ordinary functions
%escape-seq?: Private ordinary functions
%in-stream: Private ordinary functions
%next-char: Private ordinary functions
%out-stream: Private ordinary functions
%trim-datum: Private ordinary functions

(
(setf after-quoted?): Private generic functions
(setf after-quoted?): Private generic functions
(setf buffer): Private generic functions
(setf buffer): Private generic functions
(setf character-idx): Private generic functions
(setf character-idx): Private generic functions
(setf character-line-idx): Private generic functions
(setf character-line-idx): Private generic functions
(setf csv-reader): Private generic functions
(setf csv-reader): Private generic functions
(setf csv-reader): Private generic functions
(setf data): Public generic functions
(setf data): Public generic functions
(setf data-map-fn): Private generic functions
(setf data-map-fn): Private generic functions
(setf delimiter): Private generic functions
(setf delimiter): Private generic functions
(setf didx): Private generic functions
(setf didx): Private generic functions
(setf dispatch): Private generic functions
(setf dispatch): Private generic functions
(setf dlen): Private generic functions
(setf dlen): Private generic functions
(setf dlen-1): Private generic functions
(setf dlen-1): Private generic functions
(setf entries): Private generic functions
(setf entries): Private generic functions
(setf format-args): Private generic functions
(setf format-args): Private generic functions
(setf format-control): Private generic functions
(setf format-control): Private generic functions
(setf last-item): Private ordinary functions
(setf line-data): Private generic functions
(setf line-data): Private generic functions
(setf line-idx): Private generic functions
(setf line-idx): Private generic functions
(setf map-fn): Private generic functions
(setf map-fn): Private generic functions
(setf parse-stream): Private generic functions
(setf parse-stream): Private generic functions
(setf reading-quoted?): Private generic functions
(setf reading-quoted?): Private generic functions
(setf row): Public generic functions
(setf row): Public generic functions
(setf row-fn): Private generic functions
(setf row-fn): Private generic functions
(setf rows): Private generic functions
(setf rows): Private generic functions
(setf skip-row?): Private generic functions
(setf skip-row?): Private generic functions

A
after-quoted?: Private generic functions
after-quoted?: Private generic functions

B
buffer: Private generic functions
buffer: Private generic functions

C
character-idx: Private generic functions
character-idx: Private generic functions
character-line-idx: Private generic functions
character-line-idx: Private generic functions
chars-in: Private ordinary functions
check-and-distpatch: Private ordinary functions
check-table-entry: Private generic functions
check-table-entry: Private generic functions
clause-for-in-csv-1: Private macros
clause-sampling-2: Private macros
collect-datum: Private ordinary functions
collect-row-data: Private ordinary functions
csv-data-read: Public ordinary functions
csv-parse-error: Public ordinary functions
csv-reader: Private generic functions
csv-reader: Private generic functions
csv-reader: Private generic functions
csv-row-read: Public ordinary functions

D
data: Public generic functions
data: Public generic functions
data-map-fn: Private generic functions
data-map-fn: Private generic functions
delimiter: Private generic functions
delimiter: Private generic functions
didx: Private generic functions
didx: Private generic functions
dispatch: Private generic functions
dispatch: Private generic functions
dlen: Private generic functions
dlen: Private generic functions
dlen-1: Private generic functions
dlen-1: Private generic functions
do-csv: Public macros
drop-delimiter-chars: Private ordinary functions

E
entries: Private generic functions
entries: Private generic functions

F
format-args: Private generic functions
format-args: Private generic functions
format-control: Private generic functions
format-control: Private generic functions
format-csv-value: Public generic functions
format-csv-value: Public generic functions
Function, %char-in: Private ordinary functions
Function, %escape-is-double-quote: Private ordinary functions
Function, %escape-seq?: Private ordinary functions
Function, %in-stream: Private ordinary functions
Function, %next-char: Private ordinary functions
Function, %out-stream: Private ordinary functions
Function, %trim-datum: Private ordinary functions
Function, (setf last-item): Private ordinary functions
Function, chars-in: Private ordinary functions
Function, check-and-distpatch: Private ordinary functions
Function, collect-datum: Private ordinary functions
Function, collect-row-data: Private ordinary functions
Function, csv-data-read: Public ordinary functions
Function, csv-parse-error: Public ordinary functions
Function, csv-row-read: Public ordinary functions
Function, drop-delimiter-chars: Private ordinary functions
Function, last-item: Private ordinary functions
Function, make-default-csv-reader: Private ordinary functions
Function, make-table-entry: Private ordinary functions
Function, map-empty-string-to-nil: Private ordinary functions
Function, read-csv: Public ordinary functions
Function, read-csv-row: Public ordinary functions
Function, read-csv-row-with-reader: Private ordinary functions
Function, read-csv-sample: Public ordinary functions
Function, read-csv-with-reader: Private ordinary functions
Function, read-into-buffer-until: Private ordinary functions
Function, read-with-dispatch-table: Private ordinary functions
Function, reading-character: Private ordinary functions
Function, reset-table-entry: Private ordinary functions
Function, restartable-read-row: Private ordinary functions
Function, white-space?: Private ordinary functions
Function, write-csv: Public ordinary functions
Function, write-csv-row: Public ordinary functions

G
Generic Function, (setf after-quoted?): Private generic functions
Generic Function, (setf buffer): Private generic functions
Generic Function, (setf character-idx): Private generic functions
Generic Function, (setf character-line-idx): Private generic functions
Generic Function, (setf csv-reader): Private generic functions
Generic Function, (setf data): Public generic functions
Generic Function, (setf data-map-fn): Private generic functions
Generic Function, (setf delimiter): Private generic functions
Generic Function, (setf didx): Private generic functions
Generic Function, (setf dispatch): Private generic functions
Generic Function, (setf dlen): Private generic functions
Generic Function, (setf dlen-1): Private generic functions
Generic Function, (setf entries): Private generic functions
Generic Function, (setf format-args): Private generic functions
Generic Function, (setf format-control): Private generic functions
Generic Function, (setf line-data): Private generic functions
Generic Function, (setf line-idx): Private generic functions
Generic Function, (setf map-fn): Private generic functions
Generic Function, (setf parse-stream): Private generic functions
Generic Function, (setf reading-quoted?): Private generic functions
Generic Function, (setf row): Public generic functions
Generic Function, (setf row-fn): Private generic functions
Generic Function, (setf rows): Private generic functions
Generic Function, (setf skip-row?): Private generic functions
Generic Function, after-quoted?: Private generic functions
Generic Function, buffer: Private generic functions
Generic Function, character-idx: Private generic functions
Generic Function, character-line-idx: Private generic functions
Generic Function, check-table-entry: Private generic functions
Generic Function, csv-reader: Private generic functions
Generic Function, data: Public generic functions
Generic Function, data-map-fn: Private generic functions
Generic Function, delimiter: Private generic functions
Generic Function, didx: Private generic functions
Generic Function, dispatch: Private generic functions
Generic Function, dlen: Private generic functions
Generic Function, dlen-1: Private generic functions
Generic Function, entries: Private generic functions
Generic Function, format-args: Private generic functions
Generic Function, format-control: Private generic functions
Generic Function, format-csv-value: Public generic functions
Generic Function, line-data: Private generic functions
Generic Function, line-idx: Private generic functions
Generic Function, map-fn: Private generic functions
Generic Function, parse-stream: Private generic functions
Generic Function, reading-escaped: Private generic functions
Generic Function, reading-following-escaped: Private generic functions
Generic Function, reading-newline: Private generic functions
Generic Function, reading-quoted: Private generic functions
Generic Function, reading-quoted-or-escaped: Private generic functions
Generic Function, reading-quoted?: Private generic functions
Generic Function, reading-separator: Private generic functions
Generic Function, row: Public generic functions
Generic Function, row-fn: Private generic functions
Generic Function, rows: Private generic functions
Generic Function, skip-row?: Private generic functions
Generic Function, write-csv-value: Public generic functions

L
last-item: Private ordinary functions
line-data: Private generic functions
line-data: Private generic functions
line-idx: Private generic functions
line-idx: Private generic functions

M
Macro, clause-for-in-csv-1: Private macros
Macro, clause-sampling-2: Private macros
Macro, do-csv: Public macros
Macro, with-csv-input-stream: Private macros
Macro, with-csv-output-stream: Private macros
make-default-csv-reader: Private ordinary functions
make-table-entry: Private ordinary functions
map-empty-string-to-nil: Private ordinary functions
map-fn: Private generic functions
map-fn: Private generic functions
Method, (setf after-quoted?): Private generic functions
Method, (setf buffer): Private generic functions
Method, (setf character-idx): Private generic functions
Method, (setf character-line-idx): Private generic functions
Method, (setf csv-reader): Private generic functions
Method, (setf csv-reader): Private generic functions
Method, (setf data): Public generic functions
Method, (setf data-map-fn): Private generic functions
Method, (setf delimiter): Private generic functions
Method, (setf didx): Private generic functions
Method, (setf dispatch): Private generic functions
Method, (setf dlen): Private generic functions
Method, (setf dlen-1): Private generic functions
Method, (setf entries): Private generic functions
Method, (setf format-args): Private generic functions
Method, (setf format-control): Private generic functions
Method, (setf line-data): Private generic functions
Method, (setf line-idx): Private generic functions
Method, (setf map-fn): Private generic functions
Method, (setf parse-stream): Private generic functions
Method, (setf reading-quoted?): Private generic functions
Method, (setf row): Public generic functions
Method, (setf row-fn): Private generic functions
Method, (setf rows): Private generic functions
Method, (setf skip-row?): Private generic functions
Method, after-quoted?: Private generic functions
Method, buffer: Private generic functions
Method, character-idx: Private generic functions
Method, character-line-idx: Private generic functions
Method, check-table-entry: Private generic functions
Method, csv-reader: Private generic functions
Method, csv-reader: Private generic functions
Method, data: Public generic functions
Method, data-map-fn: Private generic functions
Method, delimiter: Private generic functions
Method, didx: Private generic functions
Method, dispatch: Private generic functions
Method, dlen: Private generic functions
Method, dlen-1: Private generic functions
Method, entries: Private generic functions
Method, format-args: Private generic functions
Method, format-control: Private generic functions
Method, format-csv-value: Public generic functions
Method, line-data: Private generic functions
Method, line-idx: Private generic functions
Method, map-fn: Private generic functions
Method, parse-stream: Private generic functions
Method, print-object: Public standalone methods
Method, reading-escaped: Private generic functions
Method, reading-following-escaped: Private generic functions
Method, reading-newline: Private generic functions
Method, reading-quoted: Private generic functions
Method, reading-quoted-or-escaped: Private generic functions
Method, reading-quoted?: Private generic functions
Method, reading-separator: Private generic functions
Method, row: Public generic functions
Method, row-fn: Private generic functions
Method, rows: Private generic functions
Method, skip-row?: Private generic functions
Method, write-csv-value: Public generic functions

P
parse-stream: Private generic functions
parse-stream: Private generic functions
print-object: Public standalone methods

R
read-csv: Public ordinary functions
read-csv-row: Public ordinary functions
read-csv-row-with-reader: Private ordinary functions
read-csv-sample: Public ordinary functions
read-csv-with-reader: Private ordinary functions
read-into-buffer-until: Private ordinary functions
read-with-dispatch-table: Private ordinary functions
reading-character: Private ordinary functions
reading-escaped: Private generic functions
reading-escaped: Private generic functions
reading-following-escaped: Private generic functions
reading-following-escaped: Private generic functions
reading-newline: Private generic functions
reading-newline: Private generic functions
reading-quoted: Private generic functions
reading-quoted: Private generic functions
reading-quoted-or-escaped: Private generic functions
reading-quoted-or-escaped: Private generic functions
reading-quoted?: Private generic functions
reading-quoted?: Private generic functions
reading-separator: Private generic functions
reading-separator: Private generic functions
reset-table-entry: Private ordinary functions
restartable-read-row: Private ordinary functions
row: Public generic functions
row: Public generic functions
row-fn: Private generic functions
row-fn: Private generic functions
rows: Private generic functions
rows: Private generic functions

S
skip-row?: Private generic functions
skip-row?: Private generic functions

W
white-space?: Private ordinary functions
with-csv-input-stream: Private macros
with-csv-output-stream: Private macros
write-csv: Public ordinary functions
write-csv-row: Public ordinary functions
write-csv-value: Public generic functions
write-csv-value: Public generic functions


A.3 Variables

Jump to:   *  
A   B   C   D   E   F   L   M   P   R   S  
Index Entry  Section

*
*always-quote*: Private special variables
*buffer-size*: Private special variables
*default-external-format*: Public special variables
*enable-signals*: Public special variables
*eof-char*: Private special variables
*escape-mode*: Private special variables
*quote*: Public special variables
*quote-escape*: Public special variables
*quoted-empty-string-is-nil*: Private special variables
*read-newline*: Private special variables
*separator*: Public special variables
*trim-outer-whitespace*: Private special variables
*unquoted-empty-string-is-nil*: Private special variables
*write-newline*: Private special variables

A
after-quoted?: Private classes

B
buffer: Private classes

C
character-idx: Private classes
character-line-idx: Private classes
csv-reader: Public conditions
csv-reader: Public conditions

D
data: Public conditions
data-map-fn: Private classes
delimiter: Private classes
didx: Private classes
dispatch: Private classes
dlen: Private classes
dlen-1: Private classes

E
entries: Private classes

F
format-args: Public conditions
format-control: Public conditions

L
line-data: Private classes
line-idx: Private classes

M
map-fn: Private classes

P
parse-stream: Private classes

R
reading-quoted?: Private classes
row: Public conditions
row-fn: Private classes
rows: Private classes

S
skip-row?: Private classes
Slot, after-quoted?: Private classes
Slot, buffer: Private classes
Slot, character-idx: Private classes
Slot, character-line-idx: Private classes
Slot, csv-reader: Public conditions
Slot, csv-reader: Public conditions
Slot, data: Public conditions
Slot, data-map-fn: Private classes
Slot, delimiter: Private classes
Slot, didx: Private classes
Slot, dispatch: Private classes
Slot, dlen: Private classes
Slot, dlen-1: Private classes
Slot, entries: Private classes
Slot, format-args: Public conditions
Slot, format-control: Public conditions
Slot, line-data: Private classes
Slot, line-idx: Private classes
Slot, map-fn: Private classes
Slot, parse-stream: Private classes
Slot, reading-quoted?: Private classes
Slot, row: Public conditions
Slot, row-fn: Private classes
Slot, rows: Private classes
Slot, skip-row?: Private classes
Special Variable, *always-quote*: Private special variables
Special Variable, *buffer-size*: Private special variables
Special Variable, *default-external-format*: Public special variables
Special Variable, *enable-signals*: Public special variables
Special Variable, *eof-char*: Private special variables
Special Variable, *escape-mode*: Private special variables
Special Variable, *quote*: Public special variables
Special Variable, *quote-escape*: Public special variables
Special Variable, *quoted-empty-string-is-nil*: Private special variables
Special Variable, *read-newline*: Private special variables
Special Variable, *separator*: Public special variables
Special Variable, *trim-outer-whitespace*: Private special variables
Special Variable, *unquoted-empty-string-is-nil*: Private special variables
Special Variable, *write-newline*: Private special variables