CrossClj

0.5.4 docs

SourceDocs



RECENT
    VARS
    add-into
    as-vector
    common-keys
    dir-or-file
    dir?
    file?
    illegal-arg
    java-filepath
    merge-incl
    not-contains?
    pick-dirname
    pick-filename
    pick-filename-ext
    pick-filename-name
    relative-path
    split-filename
    split-filepath
    xml-map

    « Index of all namespaces of this project

    Utility functions - mostly taken/adapted from Clj-MiscUtil:
    https://bitbucket.org/kumarshantanu/clj-miscutil/src
    (add-into old-map new-map)
    (as-vector anything)
    Convert/wrap given argument as a vector.
    
    (common-keys m1 m2)
    Find the common keys in maps m1 and m2.
    
    (dir-or-file f)
    Return :dir if f (java.io.File) is a directory, :file otherwise.
    
    (dir? d)
    Return true if d is a directory, false otherwise.
    
    (file? f)
    Return true if f is a file, false otherwise.
    
    (illegal-arg arg & more)
    Throw IllegalArgumentException using the args
    
    (java-filepath s)
    Accept path (of a file) as argument and return a uniform file path for all
    operating systems.
    Example: "C:\path\to\file.txt" becomes "C:/path/to/file.txt"
    See also: split-filepath
    (merge-incl old-map new-map)
    Merge two maps inclusively. Values get wrapped inside a vector, e.g
    user=> (merge-incl {:a 10 :b 20} {:b 30 :c 40})
    {:a [10] :b [20 30] :c [40]}
    (not-contains? haystack needle)
    Same as (not (contains? haystack needle))
    
    (pick-dirname s)
    Given a filepath, return the directory portion from it.
    
    (pick-filename s)
    Given a filepath, return the filename portion from it.
    
    (pick-filename-ext s)
    Given a filepath, return the file extension portion from it.
    
    (pick-filename-name s)
    Given a filepath, return the filename (without extension) portion from it.
    
    (relative-path base path)
    Given base path and an absolute path, finds the relative path.
    
    (split-filename s)
    Given a partial or complete file path, split into filename and extension and
    return as vector.
    (split-filepath s)
    Given a complete path, split into filedir and filename and return as vector.
    The filedir is normalized as uniform Java filepath.
    See also: java-filepath
    (xml-map e)
    Discard attributes in XML structure e and turn elements as keys
    with respective values in a nested map. Values wind up in vectors.
    Example:
    (clojure.xml/parse (slurp "filename.xml"))