[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 64

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 TrimFilename. The return value is an empty string ('') when TrimFilename returns an empty string ('').

TrimAndExpandDirectory calls ExpandFileNameUTF8 to resolve the relative path, and calls TrimFilename to get the return value for the function.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.