Class Utils
Namespace: TecnoPack
Assembly: CO0002_Templ_FlowpackHMI_V00_26_M.dll
Provides utility methods for file and path management within the Tecno Pack project.
public static class Utils
Inheritance
object ← Utils
Remarks
This static class offers functionality for obtaining full paths from relative paths, resolving temporary directories, and computing file paths relative to the caller's source file.
Fields
TEMP_FOLDER_RESOURCE_URI
The fixed URI of the temporary folder used by the project.
public const string TEMP_FOLDER_RESOURCE_URI = "%PROJECTDIR%/.temp"
Field Value
string
Remarks
This constant defines the location of temporary files relative to the project directory.
Methods
GetFullPath(string)
Resolves a relative path to a full path based on predefined resource directories.
public static string GetFullPath(string relativePath)
Parameters
relativePath string
The relative path to resolve. Supported prefixes:
- %PROJECTDIR%
- %APPLICATIONDIR%
Returns
string
The full path corresponding to the provided relative path. Returns an empty string if the prefix is unrecognized.
GetRelativeFilePathFromCaller(string, string)
Returns the absolute file path by combining the caller's source file directory with a provided relative file name.
public static string GetRelativeFilePathFromCaller(string relativeFileName, string callerFilePath = "")
Parameters
relativeFileName string
The file name or relative path to be resolved.
callerFilePath string
Automatically provided by the compiler. Represents the full path of the source file that called this method.
Do not pass this manually; it is populated using the
Returns
string
The absolute file path based on the caller's location and the provided relative file name.
GetTempFolder()
Retrieves the full path of the project's temporary folder.
public static string GetTempFolder()
Returns
string
The absolute path to the temporary folder.