Sign in Join
FPDoc Onlineexperiment

TrimAndExpandDirectory function

In unit LazFileUtils

Cleans and resolves a relative path to a base directory.

Declaration

pascal
function TrimAndExpandDirectory(const Filename: string; 
                               const BaseDir: string='') : string

Arguments

Filename

Path information for the function.

BaseDir

Base directory used to resolve a relative path.

Function result

Path information cleaned and resolved to the specified base directory.

Description

TrimAndExpandDirectory is a String function used to remove whitespace and special characters in the path information, and to resolve a relative path to the specified base directory.

TrimAndExpandDirectory calls ExpandFileNameUTF8 to resolve the relative path, and calls TrimFilename to get the return value for the function. The return value is an empty string ('') when TrimFilename returns an empty string ('').

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.