CrossClj

0.2.0 docs

SourceDocs



RECENT
    VARS
    parser
    trim

    « Index of all namespaces of this project

    (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.
    
    - 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.