M3PathElemOS
is an operating system independent interface to
basic operations on search paths and search path elements.
INTERFACEM3PathElemOS ; IMPORT M3PathElemList; TYPE T <: REFANY; PROCEDURE Uid(dir: TEXT): T;
Return a handle to denote directorydir
. Two handles that denote the same directory will returnTRUE
wwhen passed toEqual
.
PROCEDURE Equal(t1, t2: T): BOOLEAN;
ReturnTRUE
ifft1
andt2
denote the same directory.
PROCEDURE EnvExpand(dir: TEXT): TEXT;
Expand any environment variables in dir
, according to the conventions
of the operating system.
PROCEDURE RemoveParentDenotations(dir: TEXT): TEXT;
Return a pathname with as many parent directory
denotations
removed as possible.
PROCEDURE DecomposePath(path: TEXT; readOnly := FALSE): M3PathElemList.T;
path
is a list of directories separated by an OS-specific character, e.g.:
. The path is decomposed into its components and anM3PathElemList.T
is generated. Each member of the result is created by a call ofM3PathElem.FromText(EnvExpand(c), c, readOnly)
, wherec
is the component pathname.
END M3PathElemOS.