Liking cljdoc? Tell your friends :D

uncomplicate.commons.utils


capacityclj

(capacity b)
source

cond-intoclj

(cond-into x & s)
source

direct-bufferclj

(direct-buffer size)
source

dragan-says-exclj

(dragan-says-ex message)
(dragan-says-ex message data)
source

enc-keywordclj

(enc-keyword kw-map kw)
source

get-doubleclj

(get-double b i)
source

get-floatclj

(get-float b i)
source

get-intclj

(get-int b i)
source

get-longclj

(get-long b i)
source

maskclj

(mask table flags)
(mask table flag flags)
(mask table flag1 flag2 flags)

Converts keywords to a bitfield mask.

Given one or more keyword flags, creates a long bitmask that can be consumed by native functions. Needs a hashmap table that contains possible long mappings, 0-2 keywords, and a (possibly empty) list of additional keywords. If called with nil table or an unknown keyword, throws Illegalargumentexception. The inverse function is unmask.

Examples:

(mask {:a 1 :b 2 :c 4} [:a :c]) => 5
(mask {:a 1 :b 2 :c 4} :a [:c]) => 5
(mask {:a 1 :b 2 :c 4} :a :c []) => 5
Converts keywords to a bitfield mask.

Given one or more keyword `flag`s, creates a long bitmask
that can be consumed by native functions. Needs a hashmap `table` that
contains possible long mappings, 0-2 keywords, and a (possibly empty)
list of additional keywords.
If called with `nil` table or an unknown keyword, throws `Illegalargumentexception`.
The inverse function is [[unmask]].

Examples:

    (mask {:a 1 :b 2 :c 4} [:a :c]) => 5
    (mask {:a 1 :b 2 :c 4} :a [:c]) => 5
    (mask {:a 1 :b 2 :c 4} :a :c []) => 5
sourceraw docstring

pathclj

(path path-name file-name & file-names)
source

put-doubleclj

(put-double b i x)
source

put-floatclj

(put-float b i x)
source

put-intclj

(put-int b i x)
source

put-longclj

(put-long b i x)
source

slice-bufferclj

(slice-buffer buf ofst len)
source

unmaskclj

(unmask table mask)

Converts a bitfield mask to keywords.

Given a mapping table and a bitfield mask, returns a lazy sequence with decoded keyword flags contained in the bitmask. The reverse function is mask.

Examples:

(unmask {:a 1 :b 2 :c 4} 5) =>  '(:a :c)
Converts a bitfield `mask` to keywords.

Given a mapping `table` and a bitfield `mask`, returns a lazy sequence
with decoded keyword flags contained in the bitmask.
The reverse function is [[mask]].

Examples:

    (unmask {:a 1 :b 2 :c 4} 5) =>  '(:a :c)
sourceraw docstring

unmask1clj

(unmask1 table mask)

Converts a bitfield mask to one keyword.

Given a mapping table and a bitfield mask, returns the first decoded keyword that is contained in the bitmask. This is useful when we know that just one of the values in the table fits the bitmask, so the result of unmask would contain one element anyway. The reverse function is mask.

Examples:

(unmask1 {:a 1 :b 2 :c 4} 2) => :b
Converts a bitfield `mask` to one keyword.

Given a mapping `table` and a bitfield `mask`, returns the first decoded keyword
that is contained in the bitmask. This is useful when we know that just
one of the values in the table fits the bitmask, so the result of [[unmask]]
would contain one element anyway.
The reverse function is [[mask]].

Examples:

    (unmask1 {:a 1 :b 2 :c 4} 2) => :b
sourceraw docstring

with-checkcljmacro

(with-check error-fn status form)

Evaluates form if status is not zero (e.g. CL_SUCCESS), otherwise throws an appropriate ExceptionInfo with decoded informative details. It helps with native interop methods that return error codes directly, while returning computation results through side-effects in arguments.

Example:

(with-check (some-call-that-returns-error-code) result)
Evaluates `form` if `status` is not zero (e.g. `CL_SUCCESS`), otherwise throws
an appropriate `ExceptionInfo` with decoded informative details.
It helps with native interop methods that return error codes directly, while
returning computation results through side-effects in arguments.

Example:

    (with-check (some-call-that-returns-error-code) result)
sourceraw docstring

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

× close