Skip to content

spnorm

Category: path
GitHub: cute_file_system.h


Normalizes a path as a new string.

#define spnorm(s) cf_path_normalize(s)
Parameters Description
s The path string.

Remarks

All '\' are replaced with '/'. Any duplicate '////' are replaced with a single '/'. Trailing '/' are removed. Dot folders are resolved, e.g.

spnorm("/a/b/./c") -> "/a/b/c"
spnorm("/a/b/../c") -> "/a/c"
The first character is always '/', unless it's a windows drive, e.g.
spnorm("C:\\Users\\Randy\\Documents") -> "C:/Users/Randy/Documents"

spfname
spfname_no_ext
spext
spext_equ
sppop
sppopn
spcompact
spdir_of
sptop_of