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

GetAppConfigFileUTF8

Gets a UTF-8-encoded configuration file name for the current application.

Declaration

Source position: lazfileutils.pas line 156

function GetAppConfigFileUTF8(

  Global: Boolean;

  SubDir: Boolean = False;

  CreateDir: Boolean = False

):string;

Arguments

Global

  

Indicates if system-wide settings are used in the configuration file name.

SubDir

  

Indicates if a directory for the application is included in the configuration file name.

CreateDir

  

Indicates if missing directories in the configuration file path are created.

Function result

Path to the configuration file for the application.

Description

GetAppConfigFileUTF8 is a String function used to get a UTF-8-encoded configuration file name for the current application. GetAppConfigFileUTF8 calls the GetAppConfigFile function in the SysUtils unit to get the return value for the function. SysToUTF8 is called for the file name to ensure that it is encoded using the UTF-8 encoding scheme.

Global is a Boolean which indicates whether system- or user-specific path information is used in the configuration file name. When Global contains True, the system-wide configuration path is used in the return value. Otherwise, a user-specific path is used in the return value.

SubDir is a Boolean value that indicates if a sub-directory for the application is included in the path for the configuration file. When SubDir is True, a "Config" sub-directory is included in the path information.

CreateDir is a Boolean argument that indicates if any missing directories in the configuration file path are created in the function. When CreateDir is False, no additional actions are performed in the function. Otherwise, the path information is passed to ForceDirectoriesUTF8 to create any missing directories. If any of the directories are not successfully created, an EInOutError exception is raised with the message in lrsUnableToCreateConfigDirectoryS.

The return value contains the path to the configuration file including the requested path, configuration file name, and configuration file extension.

Errors

Raises an EInOutError exception when directories in the path cannot be created on the local file system.

See also

ForceDirectoriesUTF8

  

Creates the directories specified in Dir if they do not already exist.

GetAppConfigFile

SysToUTF8

  

Converts strings (and format settings) from the system codepage to UTF-8.


Version 3.2 Generated 2024-02-25 Home