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

TrimAndExpandFilename

Cleans and resolves a file path to the specified base directory name

Declaration

Source position: lazfileutils.pas line 63

function TrimAndExpandFilename(

  const Filename: string;

  const BaseDir: string = ''

):string;

Arguments

Filename

  

File name for the function

BaseDir

  

Base directory name used for a relative file path

Function result

Cleaned and resolved file path

Description

TrimAndExpandFilename is a String function used to remove whitespace and special characters in Filename, and to resolve the relative file path to the directory in BaseDir. TrimAndExpandFilename removes a trailing path delimiter in FIlename, and calls ExpandFileNameUTF8 and TrimFilename to get the return value for the function.

The return value is an empty string ('') if Filename contains an empty string ('').

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