Skip to main content

I/O

  • read-csv

    Reads CSV-data from input (String or java.io.Reader) into a lazy sequence of vectors. Valid options are :sepa...

  • write-csv

    Writes data to writer in CSV-format. Valid options are :separator (Default \,) :quote (Default \") :q...

  • read

    Reads the next object from stream, which must be an instance of java.io.PushbackReader or some derivee. stream defaul...

  • read-string

    Reads one object from the string s. Returns nil when s is nil or empty. Reads data in the edn format (subset of Cloju...

  • Coercions

    Coerce between various 'resource-namish' things.

  • IOFactory

    Factory functions that create ready-to-use, buffered versions of the various Java I/O stream types, on top of anythin...

  • as-file

    Coerce argument to a file.

  • as-relative-path

    Take an as-file-able thing and return a string if it is a relative path, else IllegalArgumentException.

  • as-url

    Coerce argument to a URL.

  • copy

    Copies input to output. Returns nil or throws IOException. Input may be an InputStream, Reader, File, byte[], char[],...

  • delete-file

    Delete file f. If silently is nil or false, raise an exception on failure, else return the value of silently.

  • exec

    Execute a command and on successful exit, return the captured output, else throw RuntimeException. Args are the same a...

  • exit-ref

    Given a Process (the output of 'start'), return a reference that can be used to wait for process completion then retur...

  • file

    Returns a java.io.File, passing each arg to as-file. Multiple-arg versions treat the first argument as parent and su...

  • file-seq

    A tree seq on java.io.Files

  • from-file

    Coerce f to a file per clojure.java.io/file and return a ProcessBuilder.Redirect reading from the file. This can be pa...

  • input-stream

    Attempts to coerce its argument into an open java.io.InputStream. Default implementations always return a java.io.Buf...

  • line-seq

    Returns the lines of text from rdr as a lazy sequence of strings. rdr must implement java.io.BufferedReader.

  • make-input-stream

    Creates a BufferedInputStream. See also IOFactory docs.

  • make-output-stream

    Creates a BufferedOutputStream. See also IOFactory docs.

  • make-parents

    Given the same arg(s) as for file, creates all parent directories of the file they represent.

  • make-reader

    Creates a BufferedReader. See also IOFactory docs.

  • make-writer

    Creates a BufferedWriter. See also IOFactory docs.

  • output-stream

    Attempts to coerce its argument into an open java.io.OutputStream. Default implementations always return a java.io.Bu...

  • read-line

    Reads the next line from stream that is the current value of *in* .

  • reader

    Attempts to coerce its argument into an open java.io.Reader. Default implementations always return a java.io.Buffered...

  • resource

    Returns the URL for a named resource. Use the context class loader if no loader is specified.

  • sh

    Passes the given strings to Runtime.exec() to launch a sub-process. Options are :in may be given followed by ...

  • slurp

    Opens a reader on f and reads all its contents, returning a string. See clojure.java.io/reader for a complete list of ...

  • spit

    Opposite of slurp. Opens f with writer, writes content, then closes f. Options passed to clojure.java.io/writer.

  • start

    Start an external command, defined in args. The process environment vars are inherited from the parent by default (u...

  • stderr

    Given a process, return the stderr of the external process (an InputStream)

  • stdin

    Given a process, return the stdin of the external process (an OutputStream)

  • stdout

    Given a process, return the stdout of the external process (an InputStream)

  • to-file

    Coerce f to a file per clojure.java.io/file and return a ProcessBuilder.Redirect writing to the file. Set ':append' in...

  • with-open

    bindings => [name init ...] Evaluates body in a try expression with names bound to the values of the inits, and a f...

  • with-sh-dir

    Sets the directory for use with sh, see sh for details.

  • with-sh-env

    Sets the environment for use with sh, see sh for details.

  • writer

    Attempts to coerce its argument into an open java.io.Writer. Default implementations always return a java.io.Buffered...

  • ->ReaderPBR

    Positional factory function for class clojure.data.json.ReaderPBR.

  • ->StringPBR

    Positional factory function for class clojure.data.json.StringPBR.

  • -write

    Print object to Appendable out as JSON

  • json-str

    DEPRECATED; replaced by 'write-str'. Converts x to a JSON-formatted string. Valid options are: :escape-unicode...

  • on-extra-throw

    Pass as :extra-data-fn to `read` or `read-str` to throw if data is found after the first object.

  • on-extra-throw-remaining

    Pass as :extra-data-fn to `read` or `read-str` to throw if data is found after the first object and return the remaini...

  • pprint

    Pretty-prints JSON representation of x to *out*. Options are the same as for write except :value-fn and :indent, which...

  • pprint-json

    DEPRECATED; replaced by 'pprint'. Pretty-prints JSON representation of x to *out*. Valid options are: :escape-...

  • print-json

    DEPRECATED; replaced by 'write' to *out*. Write JSON-formatted output to *out*. Valid options are: :escape-uni...

  • read

    Reads a single item of JSON data from a java.io.Reader. If you wish to repeatedly read items from the same reader, yo...

  • read-json

    DEPRECATED; replaced by read-str. Reads one JSON value from input String or Reader. If keywordize? is true (default...

  • read-str

    Reads one JSON value from input String. Options are the same as for read.

  • write

    Write JSON-formatted output to a java.io.Writer. Options are key-value pairs, valid options are: :escape-unicode...

  • write-json

    DEPRECATED; replaced by 'write'. Print object to PrintWriter out as JSON

  • write-str

    Converts x to a JSON-formatted string. Options are the same as write.

  • *force*

    Overrides the default rules for choosing between logging directly or via an agent. Defaults to nil. See log* for detai...

  • *logger-factory*

    An instance satisfying the clojure.tools.logging.impl/LoggerFactory protocol, which allows uniform access to an underl...

  • *logging-agent*

    The default agent used for performing logging when direct logging is disabled. See log* for details.

  • *tx-agent-levels*

    The set of levels that will require using an agent when logging from within a running transaction. Defaults to #{:info...

  • debug

    Debug level logging using print-style args. Use the 'logging.readable' namespace to avoid wrapping args in pr-str.

  • debugf

    Debug level logging using format. Use the 'logging.readable' namespace to avoid wrapping args in pr-str.

  • enabled?

    Returns true if the specific logging level is enabled. Use of this macro should only be necessary if one needs to exe...

  • error

    Error level logging using print-style args. Use the 'logging.readable' namespace to avoid wrapping args in pr-str.

  • errorf

    Error level logging using format. Use the 'logging.readable' namespace to avoid wrapping args in pr-str.

  • fatal

    Fatal level logging using print-style args. Use the 'logging.readable' namespace to avoid wrapping args in pr-str.

  • fatalf

    Fatal level logging using format. Use the 'logging.readable' namespace to avoid wrapping args in pr-str.

  • info

    Info level logging using print-style args. Use the 'logging.readable' namespace to avoid wrapping args in pr-str.

  • infof

    Info level logging using format. Use the 'logging.readable' namespace to avoid wrapping args in pr-str.

  • log

    Evaluates and logs a message only if the specified level is enabled. See log* for more details.

  • log*

    Attempts to log a message, either directly or via an agent; does not check if the level is enabled. For performance...

  • log-capture!

    Captures System.out and System.err, piping all writes of those streams to the log. If unspecified, levels default to...

  • log-stream

    Creates a PrintStream that will output to the log at the specified level.

  • log-uncapture!

    Restores System.out and System.err to their original values.

  • logf

    Logs a message using a format string and args. Can optionally take a throwable as its second arg. See level-specific m...

  • logp

    Logs a message using print style args. Can optionally take a throwable as its second arg. See level-specific macros, e...

  • spy

    Evaluates expr and may write the form and its result to the log. Returns the result of expr. Defaults to :debug log le...

  • spyf

    Evaluates expr and may write (format fmt result) to the log. Returns the result of expr. Defaults to :debug log level....

  • trace

    Trace level logging using print-style args. Use the 'logging.readable' namespace to avoid wrapping args in pr-str.

  • tracef

    Trace level logging using format. Use the 'logging.readable' namespace to avoid wrapping args in pr-str.

  • warn

    Warn level logging using print-style args. Use the 'logging.readable' namespace to avoid wrapping args in pr-str.

  • warnf

    Warn level logging using format. Use the 'logging.readable' namespace to avoid wrapping args in pr-str.

  • with-logs

    Evaluates exprs in a context in which *out* and *err* write to the log. The specified logger-ns value will be used to ...

  • *print-base*

    The base to use for printing integers and rationals.

  • *print-miser-width*

    The column at which to enter miser style. Depending on the dispatch table, miser style add newlines in more places to t...

  • *print-pprint-dispatch*

    The pretty print dispatch function. Use with-pprint-dispatch or set-pprint-dispatch to modify.

  • *print-pretty*

    Bind to true if you want write to use pretty printing

  • *print-radix*

    Print a radix specifier in front of integers and rationals. If *print-base* is 2, 8, or 16, then the radix specifier us...

  • *print-right-margin*

    Pretty printing will try to avoid anything going beyond this column. Set it to nil to have pprint let the line be arbitr...

  • *print-suppress-namespaces*

    Don't print namespaces with symbols. This is particularly useful when pretty printing the results of macro expansions

  • cl-format

    An implementation of a Common Lisp compatible format function. cl-format formats its arguments to an output stream or st...

  • code-dispatch

    The pretty print dispatch function for pretty printing Clojure code.

  • formatter

    Makes a function which can directly run format-in. The function is fn [stream & args] ... and returns nil unless the str...

  • formatter-out

    Makes a function which can directly run format-in. The function is fn [& args] ... and returns nil. This version of the ...

  • fresh-line

    Make a newline if *out* is not already at the beginning of the line. If *out* is not a pretty writer (which keeps track ...

  • get-pretty-writer

    Returns the java.io.Writer passed in wrapped in a pretty writer proxy, unless it's already a pretty writer. Generally, ...

  • pp

    A convenience macro that pretty prints the last thing output. This is exactly equivalent to (pprint *1).

  • pprint

    Pretty print object to the optional output writer. If the writer is not provided, print the object to the currently bou...

  • pprint-indent

    Create an indent at this point in the pretty printing stream. This defines how following lines are indented. relative-t...

  • pprint-logical-block

    Execute the body as a pretty printing logical block with output to *out* which must be a pretty printing writer. When u...

  • pprint-newline

    Print a conditional newline to a pretty printing stream. kind specifies if the newline is :linear, :miser, :fill, or :m...

  • pprint-tab

    Tab at this point in the pretty printing stream. kind specifies whether the tab is :line, :section, :line-relative, or :...

  • print-length-loop

    A version of loop that iterates at most *print-length* times. This is designed for use in pretty-printer dispatch funct...

  • print-table

    Prints a collection of maps in a textual table. Prints table headings ks, and then a line of output for each row, cor...

  • set-pprint-dispatch

    Set the pretty print dispatch function to a function matching (fn [obj] ...) where obj is the object to pretty print. Th...

  • simple-dispatch

    The pretty print dispatch function for simple data structure format.

  • with-pprint-dispatch

    Execute body with the pretty print dispatch function bound to function.

  • write

    Write an object subject to the current bindings of the printer control variables. Use the kw-args argument to override i...

  • write-out

    Write an object to *out* subject to the current bindings of the printer control variables. Use the kw-args argument to ...

  • flush

    Flushes the output stream that is the current value of *out*

  • newline

    Writes a platform-specific newline to *out*

  • pr

    Prints the object(s) to the output stream that is the current value of *out*. Prints the object(s), separated by spac...

  • pr-str

    pr to a string, returning it

  • print

    Prints the object(s) to the output stream that is the current value of *out*. print and println produce output for hu...

  • print-str

    print to a string, returning it

  • printf

    Prints formatted output, as per format

  • println

    Same as print followed by (newline)

  • println-str

    println to a string, returning it

  • prn

    Same as pr followed by (newline). Observes *flush-on-newline*

  • prn-str

    prn to a string, returning it

  • with-out-str

    Evaluates exprs in a context in which *out* is bound to a fresh StringWriter. Returns the string created by any neste...

  • *alias-map*

    Map from ns alias to ns, if non-nil, it will be used to resolve read-time ns aliases instead of (ns-aliases *ns*). ...

  • *data-readers*

    Map from reader tag symbols to data reader Vars. Reader tags without namespace qualifiers are reserved for Clojure. ...

  • *default-data-reader-fn*

    When no data reader is found for a tag and *default-data-reader-fn* is non-nil, it will be called with two arguments,...

  • *read-eval*

    Defaults to true. ***WARNING*** This setting implies that the full power of the reader is in play, including s...

  • default-data-readers

    Default map of data reader functions provided by Clojure. May be overridden by binding *data-readers*

  • map-func

    Decide which map type to use, array-map if less than 16 elements

  • read

    Reads the first object from an IPushbackReader or a java.io.PushbackReader. Returns the object read. If EOF, throws i...

  • read

    Reads the first object from an IPushbackReader or a java.io.PushbackReader. Returns the object read. If EOF, throws i...

  • read+string

    Like read, and taking the same args. reader must be a SourceLoggingPushbackReader. Returns a vector containing the obj...

  • read-string

    Reads one object from the string s. Returns nil when s is nil or empty. ***WARNING*** Note that read-string ca...

  • read-string

    Reads one object from the string s. Returns nil when s is nil or empty. Reads data in the edn format (subset of C...

  • resolve-symbol

    Resolve a symbol s into its fully qualified namespace version

  • syntax-quote

    Macro equivalent to the syntax-quote reader macro (`).

  • read

    Reads the next object from stream, which must be an instance of java.io.PushbackReader or some derivee. stream defaul...

  • read+string

    Like read, and taking the same args. stream must be a LineNumberingPushbackReader. Returns a vector containing the obj...

  • read-string

    Reads one object from the string s. Optionally include reader options, as specified in read. Note that read-string ...

XML

62
  • ->CDataEvent

    Positional factory function for class clojure.data.xml.event.CDataEvent.

  • ->CharsEvent

    Positional factory function for class clojure.data.xml.event.CharsEvent.

  • ->CommentEvent

    Positional factory function for class clojure.data.xml.event.CommentEvent.

  • ->EmptyElementEvent

    Positional factory function for class clojure.data.xml.event.EmptyElementEvent.

  • ->QNameEvent

    Positional factory function for class clojure.data.xml.event.QNameEvent.

  • ->StartElementEvent

    Positional factory function for class clojure.data.xml.event.StartElementEvent.

  • alias-uri

    Define a Clojure namespace aliases for xmlns uris. This sets up the current namespace for reading qnames denoted with...

  • cdata

    Create a CData node

  • disable-external-entities

    Modifies a SAXParser to disable external entity resolution to prevent XXE attacks

  • element

    Create an xml Element from content varargs

  • element*

    Create an xml element from a content collection and optional metadata

  • element-nss

    Get xmlns environment from element

  • emit

    Prints the given Element tree as XML text to stream. Options: :encoding <str> Character encoding to use ...

  • emit-str

    Emits the Element to String and returns it. Options: :encoding <str> Character encoding to use :doct...

  • event-seq

    Parses an XML input source into a lazy sequence of pull events. Input source can be a java.io.InputStream or java.io.Re...

  • event-tree

    Returns a lazy tree of Element objects for the given seq of Event objects. See source-seq and parse.

  • flatten-elements

    Flatten a collection of elements to an event seq

  • indent

    Emits the XML and indents the result. WARNING: this is slow it will emit the XML and read it in again to indent it. ...

  • indent-str

    Emits the XML and indents the result. Writes the results to a String and returns it

  • map->CDataEvent

    Factory function for class clojure.data.xml.event.CDataEvent, taking a map of keywords to field values.

  • map->CharsEvent

    Factory function for class clojure.data.xml.event.CharsEvent, taking a map of keywords to field values.

  • map->CommentEvent

    Factory function for class clojure.data.xml.event.CommentEvent, taking a map of keywords to field values.

  • map->EmptyElementEvent

    Factory function for class clojure.data.xml.event.EmptyElementEvent, taking a map of keywords to field values.

  • map->QNameEvent

    Factory function for class clojure.data.xml.event.QNameEvent, taking a map of keywords to field values.

  • map->StartElementEvent

    Factory function for class clojure.data.xml.event.StartElementEvent, taking a map of keywords to field values.

  • parse

    Parses an XML input source into a a tree of Element records. The element tree is realized lazily, so huge XML files can ...

  • parse

    Parses and loads the source s, which can be a File, InputStream or String naming a URI. Returns a tree of the xml/elem...

  • parse-str

    Parses an XML String into a a tree of Element records. Options: :include-node? subset of #{:element :characters :com...

  • print-uri-file-command!

    Shell command to create a dummy file for xmlns. Execute from a source root.

  • qname-local

    Get the name for this qname

  • qname-uri

    Get the namespace uri for this qname

  • sax-parser

    Create a new SAXParser

  • seq-tree

    Takes a seq of events that logically represents a tree by each event being one of: enter-sub-tree event, exit-sub-tr...

  • sexp-as-element

    Convert a single sexp into an Element

  • sexps-as-fragment

    Convert a compact prxml/hiccup-style data structure into the more formal tag/attrs/content format. A seq of elements ...

  • startparse-sax

    A startparse function suitable for use with clojure.xml/parse. Note that this function is open to XXE entity attacks, ...

  • startparse-sax-safe

    A startparse function suitable for use with clojure.xml/parse. External entity resolution is disabled to prevent XXE e...

  • uri-file

    Dummy file name for :require'ing xmlns uri

  • xml-comment

    Create a Comment node