Liking cljdoc? Tell your friends :D

clj-foundation.io

io address three primary concerns:

  • Smoothing necessary Java interop for IO operations, particularly between strings and streams/writers
  • Extending clojure.java.io to allow specifying an environment variable to use as the input source
  • (de)Serializing Clojure data structures
io address three primary concerns:
* Smoothing necessary Java interop for IO operations, particularly between strings and streams/writers
* Extending clojure.java.io to allow specifying an environment variable to use as the input source
* (de)Serializing Clojure data structures
raw docstring

bin-deserializeclj

(bin-deserialize filename)
source

bin-serializeclj

(bin-serialize filename o)
source

ByteArrayclj

source

clojure-file-inputsclj

The data types allowed as input to io/input-stream

The data types allowed as input to io/input-stream
sourceraw docstring

ClojureFileInputsclj

The set of types Clojure allows for opening files/streams

The set of types Clojure allows for opening files/streams
sourceraw docstring

deserializeclj

(deserialize filename)
source

EnvironmentVariableclj

The name of a java system variable or O/S environment variable (in that order) that may override a ResourcePath.

The name of a java system variable or O/S environment variable (in that order) that may override
a ResourcePath.
sourceraw docstring

ExtendedFileInputsclj

Clojure's file inputs plus extensions for reading from either Jar resources or Files.

Clojure's file inputs plus extensions for reading from either Jar resources or Files.
sourceraw docstring

input-streamclj

(input-stream file-input)

Inputs: [file-input :- ExtendedFileInputs] Returns: InputStream

Read and return a text file as an InputStream. Supported sources are the same as io/input-stream, with the following additions: ResourceOverrideMap and ResourceOverrideVector. See: (doc schema-name) for more information on these schema types.

Inputs: [file-input :- ExtendedFileInputs]
Returns: InputStream

Read and return a text file as an InputStream.  Supported sources are the same as io/input-stream, with
the following additions: ResourceOverrideMap and ResourceOverrideVector.  See: (doc schema-name)
for more information on these schema types.
sourceraw docstring

normalize-file-inputclj

(normalize-file-input file-input)

Inputs: [file-input :- ExtendedFileInputs] Returns: ClojureFileInputs

If the file-input is a string and can be converted to a resource URL, return that. If the file-input is a FileLocation, translate the :resource string to a URL and return that, otherwise return a File object wrapping the :file entry. Otherwise, return the original file-input.

Inputs: [file-input :- ExtendedFileInputs]
Returns: ClojureFileInputs

If the file-input is a string and can be converted to a resource URL, return that.
If the file-input is a FileLocation, translate the :resource string to a URL and return that,
otherwise return a File object wrapping the :file entry.  Otherwise, return the original file-input.
sourceraw docstring

(print-writer stream thing)

Print thing to writer

Print thing to writer
sourceraw docstring

println-writercljmacro

(println-writer stream thing)

Println thing to writer

Println thing to writer
sourceraw docstring

read-fileclj

(read-file file-input)

Inputs: [file-input :- ExtendedFileInputs] Returns: s/Str

Read and return a text file as a String. Supported sources are the same as io/input-stream, with the following additions: ResourceOverrideMap and ResourceOverrideVector. See: (doc schema-name) for more information on these types.

Inputs: [file-input :- ExtendedFileInputs]
Returns: s/Str

Read and return a text file as a String.  Supported sources are the same as io/input-stream, with
the following additions: ResourceOverrideMap and ResourceOverrideVector.  See: (doc schema-name)
for more information on these types.
sourceraw docstring

read-templateclj

(read-template file-location & ex-substitutions)

Inputs: [file-location :- ExtendedFileInputs & ex-substitutions] Returns: s/Str

Read a file from file-location, applying any variable substitutions specified in the file using the keyword/value pairs in substitutions.

Supported sources are the same as io/input-stream, with the following additions: ResourceOverrideMap and ResourceOverrideVector. See: (doc schema-name) and (explain schema-name) for more information on these types.

Inputs: [file-location :- ExtendedFileInputs & ex-substitutions]
Returns: s/Str

Read a file from file-location, applying any variable substitutions specified
in the file using the keyword/value pairs in substitutions.

Supported sources are the same as io/input-stream, with the following additions:
ResourceOverrideMap and ResourceOverrideVector.  See: (doc schema-name) and (explain schema-name)
for more information on these types.
sourceraw docstring

resource-as-stringclj

(resource-as-string & resource-spec)

Inputs: [& resource-spec :- [s/Str]] Returns: s/Str

1-arg variant: Reads the specified classpath resource and returns its contents as a string. 2-arg variant: ["ENVAR" "resource-file.txt"] - Allows resource-file to be overridden as-in read-file.

Inputs: [& resource-spec :- [s/Str]]
Returns: s/Str

1-arg variant: Reads the specified classpath resource and returns its contents as a string.
 2-arg variant: ["ENVAR" "resource-file.txt"] - Allows resource-file to be overridden as-in read-file.
sourceraw docstring

ResourceOverrideMapclj

Read the file specified by :file or the resource specified by :resource. If both entries are defined, the :file entry takes precedence over the :resource entry.

Read the file specified by :file or the resource specified by :resource.  If both entries are defined,
the :file entry takes precedence over the :resource entry.
sourceraw docstring

ResourceOverrideVectorclj

Read the resource at ResourcePath unless a Java system variable or an O/S EnvironmentVariable is present with the specified name. In that case, use the value referenced by EnvironmentVariable as a file system path to the actual file.

Read the resource at ResourcePath unless a Java system variable or an O/S EnvironmentVariable
is present with the specified name.  In that case, use the value referenced by EnvironmentVariable
as a file system path to the actual file.
sourceraw docstring

ResourcePathclj

A path to a JAR file resource on the classapth.

A path to a JAR file resource on the classapth.
sourceraw docstring

serializeclj

(serialize filename data-structure)

Print a data structure to a file so that we may read it in later.

Print a data structure to a file so that we may read it in later.
sourceraw docstring

string-input-streamclj

(string-input-stream input)

Inputs: [input :- s/Str] Returns: InputStream

Return a java.io.InputStream containing the input string

Inputs: [input :- s/Str]
Returns: InputStream

Return a java.io.InputStream containing the input string
sourceraw docstring

string-output-writerclj

(string-output-writer)

Create a java.io.PrintWriter whose .toString contains the data printed to it.

Create a java.io.PrintWriter whose .toString contains the data printed to it.
sourceraw docstring

with-err-strcljmacro

(with-err-str & body)

Anything printed within body to err will be returned as a string.

Anything printed within body to *err* will be returned as a string.
sourceraw docstring

with-out-writercljmacro

(with-out-writer f & body)

Opens a writer on f, binds it to out, and evaluates body. Anything printed within body will be written to f.

Opens a writer on f, binds it to *out*, and evaluates body.
Anything printed within body will be written to f.
sourceraw docstring

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

× close