IsUTF8PathLengthValid
- Updated2023-02-21
- 1 minute(s) read
IsUTF8PathLengthValid
int IsUTF8PathLengthValid (char *path, int *isValid, char **overLimitPtr);
Purpose
Checks whether a UTF-8 string is within the characer limit to represent a valid path.
IsUTF8PathLengthValid sets the isValid parameter to 1 when the UTF-8 string is within the character limit for a valid path.
IsUTF8PathLengthValid sets the isValid parameter to 0 when the UTF-8 string exceeds the character limit for a valid path. Additionally, overLimitPtr points to the characters that need to be truncated in order to obtain a valid path. Refer to MAX_PATHNAME_LEN to find out more about maximum path lengths.
Example Code
char *pathName = "C:\mypath.txt";
int isValid = 0;
IsUTF8PathLengthValid(pathName, &isValid, NULL);
Parameters
Input | ||
Name | Type | Description |
path | char * | Input path. |
Output | ||
Name | Type | Description |
isValid | int | Pointer to an integer value that will be set to 1 if the path length is valid, 0 otherwise. |
overLimitPtr | char * | Optional. If the path length excceeds the character limit, overLimitPtr will point to the end of the longest subsequence in the input string that represents a valid path. Otherwise, it will be NULL. |
Return Value
Name | Type | Description | ||||||||||
result | int | Return value indicating whether the function was successful. A negative number indicates that an error occurred.
|
Additional Information
Library: Utility Library
Include file: utility.h
LabWindows/CVI compatibility: LabWindows/CVI 2020 and later