Input and Output processors.
Input and Output processors.
(csv)
(csv spec)
Accepts map, creates DSV 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 DSV 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.
(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.
(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]}).
(gzip-input-stream file-like & opts)
Return output-stream with GZIPInputStream within.
Return output-stream with GZIPInputStream within.
(gzip-output-stream file-like & opts)
Return output-stream with GZIPOutputStream within.
Return output-stream with GZIPOutputStream within.
(gzip-reader file-like & opts)
Return reader with GZIPInputStream within.
Return reader with GZIPInputStream within.
(gzip-writer file-like & opts)
Return writer with GZIPOutputStream within.
Return writer with GZIPOutputStream within.
(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.
(in! spec source)
Read source, feed data to processor, return result.
Read source, feed data to processor, return result.
(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.
(sink spec target)
Returned callable will eat seq and write to target.
Returned callable will eat seq and write to target.
(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.
(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.
(string-reader a-string & opts)
Return a function providing StringReader over a given String.
Return a function providing StringReader over a given String.
(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.
(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:
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.
(xml-realizer parsed-xml)
Get parsed XML, touch every node, return head.
Get parsed XML, touch every node, return head.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close