Liking cljdoc? Tell your friends :D

szew.io

Input and Output processors.

Input and Output processors.
raw docstring

csvclj

(csv)
(csv spec)

Accepts map, creates CSV spec, good for reading and writing.

:field |R|W| Default | Description -------------+-+-+--------------------+-------------------------------------- :encoding |X|X| UTF-8 | File encoding, String. :append | |X| false | Append to file? Boolean. :delimiter |X|X| , | Field delimiter, char or String. :strict |X| | true | Fail in malformed input? Boolean. :eol | |X| Env line.separator | End Of Line, char or String. :quote-char |X|X| " | Quote character, char. :force-quote | |X| false | Quote ALL fields. Boolean. :part | |X| 64 | Writer partitioning. Positive int. :processor |X| | vec | Your callable. :reader |X| | c.j.io/reader | Reader provider. :writer | |X| c.j.io/writer | Writer provider.

Invoking (csv) produces default spec.

Accepts map, creates CSV spec, good for reading and writing.

:field       |R|W| Default            | Description
-------------+-+-+--------------------+--------------------------------------
:encoding    |X|X| UTF-8              | File encoding, String.
:append      | |X| false              | Append to file? Boolean.
:delimiter   |X|X| \,                 | Field delimiter, char or String.
:strict      |X| | true               | Fail in malformed input? Boolean.
:eol         | |X| Env line.separator | End Of Line, char or String.
:quote-char  |X|X| \"                 | Quote character, char.
:force-quote | |X| false              | Quote ALL fields. Boolean.
:part        | |X| 64                 | Writer partitioning. Positive int.
:processor   |X| | vec                | Your callable.
:reader      |X| | c.j.io/reader      | Reader provider.
:writer      | |X| c.j.io/writer      | Writer provider.

Invoking (csv) produces default spec.
raw docstring

ednclj

(edn)
(edn spec)

Accepts map, creates EDN spec, good for reading and writing.

:field |R|W| Default | Description -------------+-+-+----------------------+------------------------------------ :encoding |X|X| UTF-8 | File encoding, String. :append | |X| false | Append to file? Boolean. :processor |X| | vec | Your callable. :readers |X| | nil | Custom readers for clojure.edn. :default |X| | vector | Default callable for tag+value. :reader |X| | c.j.io/reader | Reader provider. :writer | |X| c.j.io/writer | Writer provider.

Invoking (edn) produces default spec.

Accepts map, creates EDN spec, good for reading and writing.

:field       |R|W| Default              | Description
-------------+-+-+----------------------+------------------------------------
:encoding    |X|X| UTF-8                | File encoding, String.
:append      | |X| false                | Append to file? Boolean.
:processor   |X| | vec                  | Your callable.
:readers     |X| | nil                  | Custom readers for clojure.edn.
:default     |X| | vector               | Default callable for tag+value.
:reader      |X| | c.j.io/reader        | Reader provider.
:writer      | |X| c.j.io/writer        | Writer provider.

Invoking (edn) produces default spec.
raw docstring

filesclj

(files)
(files spec)

Accepts map, creates Files spec, good for reading.

:field |R|W| Default | Description -------------+-+-+--------------------+-------------------------------------- :follow? | |X| (constantly true) | Keep? Predicate: File -> Boolean. :processor |X| | vec | Your callable.

Invoking (files) produces default spec.

Accepts map, creates Files spec, good for reading.

:field       |R|W| Default            | Description
-------------+-+-+--------------------+--------------------------------------
:follow?     | |X| (constantly true)  | Keep? Predicate: File -> Boolean.
:processor   |X| | vec                | Your callable.

Invoking (files) produces default spec.
raw docstring

fixed-widthclj

(fixed-width)
(fixed-width spec)

Accepts map, creates FixedWidth spec, good for reading and writing.

:field |R|W| Default | Description -------------+-+-+--------------------+-------------------------------------- :encoding |X|X| UTF-8 | File encoding, String. :append | |X| false | Append to file? Boolean. :eol | |X| Env line.separator | End Of Line, char or String. :strict |X| | true | Fail in malformed input? Boolean. :widths [X|X] [1] | Slice sizes, vec of positive ints. :final-eol |X|X| false | Add EOL at the end? Boolean. :fill-char | |X| \space | Right fill character, char. :part | |X| 64 | Writer partitioning. Positive int. :processor |X| | vec | Your callable. :reader |X| | c.j.io/reader | Reader provider. :writer | |X| c.j.io/writer | Writer provider.

Invoking (fixed-width) produces default spec (with: {:widths [1]}).

Accepts map, creates FixedWidth spec, good for reading and writing.

:field       |R|W| Default            | Description
-------------+-+-+--------------------+--------------------------------------
:encoding    |X|X| UTF-8              | File encoding, String.
:append      | |X| false              | Append to file? Boolean.
:eol         | |X| Env line.separator | End Of Line, char or String.
:strict      |X| | true               | Fail in malformed input? Boolean.
:widths      [X|X] [1]                | Slice sizes, vec of positive ints.
:final-eol   |X|X| false              | Add EOL at the end? Boolean.
:fill-char   | |X| \space             | Right fill character, char.
:part        | |X| 64                 | Writer partitioning. Positive int.
:processor   |X| | vec                | Your callable.
:reader      |X| | c.j.io/reader      | Reader provider.
:writer      | |X| c.j.io/writer      | Writer provider.

Invoking (fixed-width) produces default spec (with: {:widths [1]}).
raw docstring

gzip-input-streamclj

(gzip-input-stream file-like & opts)

Return output-stream with GZIPInputStream within.

Return output-stream with GZIPInputStream within.
raw docstring

gzip-output-streamclj

(gzip-output-stream file-like & opts)

Return output-stream with GZIPOutputStream within.

Return output-stream with GZIPOutputStream within.
raw docstring

gzip-readerclj

(gzip-reader file-like & opts)

Return reader with GZIPInputStream within.

Return reader with GZIPInputStream within.
raw docstring

gzip-writerclj

(gzip-writer file-like & opts)

Return writer with GZIPOutputStream within.

Return writer with GZIPOutputStream within.
raw docstring

hasherclj

(hasher)
(hasher spec)

Accepts map, creates Hasher spec, good for reading and writing.

:field |R|W| Default | Description --------------+-+-+---------------------+------------------------------------ :hash-name |X| | SHA-256 | Hash algo name. :skip-bytes |X| | 0 | Skip bytes, non-negative int. :sample-size |X| | :full | How many bytes, :full or pos. int. :input-stream |X| | c.j.io/input-stream | InputStream provider.

Accepts map, creates Hasher spec, good for reading and writing.

:field        |R|W| Default             | Description
--------------+-+-+---------------------+------------------------------------
:hash-name    |X| | SHA-256             | Hash algo name.
:skip-bytes   |X| | 0                   | Skip bytes, non-negative int.
:sample-size  |X| | :full               | How many bytes, :full or pos. int.
:input-stream |X| | c.j.io/input-stream | InputStream provider.
raw docstring

Inputcljprotocol

in!clj

(in! spec source)

Read source, feed data to processor, return result.

Read source, feed data to processor, return result.

linesclj

(lines)
(lines spec)

Accepts map, creates Lines spec, good for reading and writing.

:field |R|W| Default | Description -----------+-+-+--------------------+--------------------------------------- :encoding |X|X| UTF-8 | File encoding, String. :eol | |X| Env line.separator | End Of Line, char or String. :append | |X| false | Append to file? Boolean. :final-eol | |X| false | Additional EOL? Boolean. :part | |X| 64 | Writer partitioning. Positive int. :processor |X| | vec | Your callable. :reader |X| | c.j.io/reader | Reader provider. :writer | |X| c.j.io/writer | Writer provider.

Invoking (lines) produces default spec.

Accepts map, creates Lines spec, good for reading and writing.

:field     |R|W| Default            | Description
-----------+-+-+--------------------+---------------------------------------
:encoding  |X|X| UTF-8              | File encoding, String.
:eol       | |X| Env line.separator | End Of Line, char or String.
:append    | |X| false              | Append to file? Boolean.
:final-eol | |X| false              | Additional EOL? Boolean.
:part      | |X| 64                 | Writer partitioning. Positive int.
:processor |X| | vec                | Your callable.
:reader    |X| | c.j.io/reader      | Reader provider.
:writer    | |X| c.j.io/writer      | Writer provider.

Invoking (lines) produces default spec.
raw docstring

Outputcljprotocol

sinkclj

(sink spec target)

Returned callable will eat seq and write to target.

Returned callable will eat seq and write to target.

pass-through-writerclj

(pass-through-writer a-writer & opts)

Return a function passing over provided writer. Like a StringWriter.

Return a function passing over provided writer. Like a StringWriter.
raw docstring

pruning-file-seqclj

(pruning-file-seq entry)
(pruning-file-seq entry follow?)

Like file-seq, but can prune files and directories based on predicate.

If follow? returns false - file/directory is not processed, nor entered.

Predicate will be first executed on given entry.

If predicate not given it just calls file-seq.

Why?

Ever went into a massive .svn directory? Now you can have tree-seq that prunes the entire path of enquiry and moves on.

Like file-seq, but can prune files and directories based on predicate.

If `follow?` returns false - file/directory is not processed, nor entered.

Predicate will be first executed on given entry.

If predicate not given it just calls file-seq.

Why?

Ever went into a massive .svn directory? Now you can have tree-seq that
prunes the entire path of enquiry and moves on.
raw docstring

prunning-file-seqclj

Those who can't spell - shim.

Those who can't spell - shim.
raw docstring

string-readerclj

(string-reader a-string & opts)

Return a function providing StringReader over a given String.

Return a function providing StringReader over a given String.
raw docstring

tsvclj

(tsv)
(tsv spec)

Accepts map, creates TSV spec, good for reading and writing.

This constructor delegates to csv, changes only :delimiter.

Invoking (tsv) produces default spec.

Accepts map, creates TSV spec, good for reading and writing.

This constructor delegates to csv, changes only :delimiter.

Invoking (tsv) produces default spec.
raw docstring

xmlclj

(xml)
(xml spec)

Accepts map, creates XML spec, good for reading and writing.

:field |R|W| Default | Description -------------+-+-+----------------------+------------------------------------ :encoding |X|X| UTF-8 | File encoding, String. :append | |X| false | Append to file? Boolean. :processor |X| | szew.io/xml-realizer | Your callable. :reader |X| | c.j.io/reader | Reader provider. :writer | |X| c.j.io/writer | Writer provider.

Invoking (xml) produces default spec.

Tips:

  1. Uses clojure.data.xml/parse and clojure.data.xml/emit
  2. Feed to clojure.zip/xml-zip first
  3. clojure.data.zip.xml next: xml->, attr=, attr, :tag, tag=, text & text=
  4. clojure.zip/node within! xml-> will extract whole loc from zip
  5. xml-> returns sequence of matches.
Accepts map, creates XML spec, good for reading and writing.

:field       |R|W| Default              | Description
-------------+-+-+----------------------+------------------------------------
:encoding    |X|X| UTF-8                | File encoding, String.
:append      | |X| false                | Append to file? Boolean.
:processor   |X| | szew.io/xml-realizer | Your callable.
:reader      |X| | c.j.io/reader        | Reader provider.
:writer      | |X| c.j.io/writer        | Writer provider.

Invoking (xml) produces default spec.

Tips:

1. Uses clojure.data.xml/parse and clojure.data.xml/emit
2. Feed to clojure.zip/xml-zip first
3. clojure.data.zip.xml next: xml->, attr=, attr, :tag, tag=, text & text=
4. clojure.zip/node within! xml-> will extract whole loc from zip
5. xml-> returns sequence of matches.
raw docstring

xml-realizerclj

(xml-realizer parsed-xml)

Get parsed XML, touch every node, return head.

Get parsed XML, touch every node, return head.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close