(parser spec)
(parser spec {:keys [encoding] :or {encoding "UTF-8"}})
Create parser fn for parsing fixed length fields from strings.
Spec should be vector of tuples.
Spec tuples have two mandatory fields and third optional field.
Options:
:encoding
- (optional) Encoding to be used when strings are converted to and from byte-arrays.Create parser fn for parsing fixed length fields from strings. Spec should be vector of tuples. Spec tuples have two mandatory fields and third optional field. - key: If truthy the read value will be added to the resulting map under this key. - length: Length of the field in bytes. - (optional) transform: Transformation function, takes in the read and trimmed string. Options: - `:encoding` - (optional) Encoding to be used when strings are converted to and from byte-arrays.
(trim s)
Return trimmed string or nil
if the string is empty.
Return trimmed string or `nil` if the string is empty.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close