From 9bb3e76ac74cfac6a04f6f212f97339f2922683e Mon Sep 17 00:00:00 2001 From: dsiders Date: Tue, 31 Oct 2023 04:27:08 +0100 Subject: [PATCH] Docs: LazUtils/lazfileutils. Adds content and fixes grammar in topics, including: * TryCreateRelativePath * CreateRelativePath * GetDarwinSystemFilename * GetDarwinNormalizedFilename --- docs/xml/lazutils/lazfileutils.xml | 97 ++++++++++++++++++++++-------- 1 file changed, 71 insertions(+), 26 deletions(-) diff --git a/docs/xml/lazutils/lazfileutils.xml b/docs/xml/lazutils/lazfileutils.xml index 66de7e8bda..c8c5f2cd36 100644 --- a/docs/xml/lazutils/lazfileutils.xml +++ b/docs/xml/lazutils/lazfileutils.xml @@ -1243,42 +1243,48 @@ Base directory used to resolve a relative path reference in the file name. -Attempts to create a path in Dest relative the path in Source. +Attempts to create a path in Dest relative to the path in Source.

Returns True if it is possible to create a relative path from Source -to Dest Function must be thread safe, so no expanding of filenames is done, +to Dest. The function must be thread safe, so no expansion of filenames is done since this is not thread-safe (at least on Windows platform).

  • -Dest and Source must either be both absolute filenames, or relative +Both Dest and Source must be either absolute filenames or relative file names.
  • -Dest and Source cannot contain '..' since no expanding is done by design +Dest and Source cannot contain '..' since no expansion is done by design. +
  • +
  • +Dest and Source must be on same drive or UNC path (Windows).
  • -
  • Dest and Source must be on same drive or UNC path (Windows)
  • If both Dest and Source are relative they must at least share their base -directory +directory.
  • -Double PathDelims are ignored (unless they are part of the UNC convention) +Double PathDelims are ignored (unless they are part of the UNC convention).
  • -If UsePointDirectory is True and Result is True then if RelPath -is Empty string, RelPath becomes '.' +If UsePointDirectory is True and RelPath is an empty string (''), +RelPath is set to the current directory ('.').
  • If AlwaysRequireSharedBaseFolder is False then Absolute filenames need -not share a basefolder +not share a base folder.
  • -if the function succeeds RelPath contains the relative path from Source to -Dest, no PathDelimiter is appended to the end of RelPath +If the function succeeds, RelPath contains the relative path from Source to +Dest. A PathDelimiter is not appended to the end of RelPath.
+ +TryCreateRelativePath does not physically create any folders need for the +derived relative path to Dest. +

Examples:

@@ -1300,22 +1306,36 @@ Dest, no PathDelimiter is appended to the end of RelPath
- + +Returns True if the path from Source to Dest is a relative path that can +be derived using the arguments to the routine. + - + +Path to the destination directory (relative or absolute). + - + +Path to the source directory (relative or absolute). + - + +True if RelPath is set to '.' when an empty relative path ('') is +derived from Source to Dest. + - + +False requires use of absolute paths in both Source and Dest. + - + +Returns the relative path from Source to Dest derived in the routine. + @@ -1340,7 +1360,9 @@ CreateRelativePath is thread safe, and therefore, does not guarantee that the current directory is correct for file names like 'D:test.txt'. - + + + Relative path from the base directory for the file name. @@ -3370,7 +3392,10 @@ C:\ - + +Gets a file name using the Core Foundation CFStringGetFileSystemRepresentation +API on macOS. +

Implemented when the platform or OS includes the darwin compiler @@ -3381,16 +3406,29 @@ platform. - + +UTF-8-encoded file name from the Core Foundation API. + - + +File name converted in the routine. + - + +Gets a normalized file name using the Core Foundation CFStringNormalizationForm +API on macOS. +

+Normalizes the string in FileName into the specified form as described in +Unicode Technical Report #15. Supported normalization forms include +Compatibility Decomposition, and Canonical Decomposition followed by Canonical +Composition (default). +

+

Implemented when the platform or OS includes the darwin compiler define. Handles canonical string normalization forms for file names on the Darwin platform. @@ -3399,13 +3437,20 @@ Darwin platform. - + +UTF-8-encoded value for the normalized file name. + - + +File name normalized in the routine. + - + +Normalization form requested in the routine. Default value is 2 (Canonical +Decomposition followed by Canonical Composition). +