[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'LazFileUtils' (#lazutils)

TrimAndExpandDirectory

Cleans and resolves a relative path to a base directory.

Declaration

Source position: lazfileutils.pas line 65

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

ExpandFileNameUTF8

  

Expands the values in FileName and BaseDir to an absolute file name.

TrimFilename

  

Removes leading and trailing spaces, and resolves special characters.


Version 3.2 Generated 2024-02-25 Home