Utility class providing helper methods for common operations.
Static methods
staticconvertAbsToURL(path:String):String
Converts an absolute file path to a URL string.
Parameters:
path | The absolute file path to convert. |
---|
Returns:
The corresponding URL string.
staticgetPosFromContext(ctx:RawConstPointer<LibVLC_Log_T>):PosInfos
Retrieves file and line number information from a LibVLC log context.
This method calls libvlc_log_get_context
to extract the source file name and
line number associated with a particular log entry. The module information is
ignored. If no file name is available, an empty string is returned.
Parameters:
ctx | A pointer to a |
---|
Returns:
A PosInfos
object containing the normalized file name, line number, and empty class/method names.
staticgetStringFromFormat(fmt:ConstCharStar, args:VarList):String
Formats a string using a format specifier and a list of arguments.
This method uses the vsnprintf
function to format the string.
Parameters:
fmt | The format specifier string. |
---|---|
args | The list of arguments to format the string with. |
Returns:
The formatted string.
staticmkDirs(directory:String):Void
Creates directories recursively.
This method ensures that all directories in the specified path are created.
If a directory already exists, it is skipped.
If a file exists with the same name as a directory, it is deleted before creating the directory.
Parameters:
directory | The path of the directory to create. |
---|
staticnormalizePath(location:String):String
Normalizes a file path based on the operating system.
On Windows, it converts forward slashes ('/') to backslashes ('\') after normalizing the path. On other platforms, it simply normalizes the path without altering the slashes.
Parameters:
location | The file path to normalize. |
---|
Returns:
The normalized file path.
staticreadFromInput(input:BytesInput, buf:Pointer<UInt8>, len:Int):Int
Reads data from a BytesInput
stream into a raw memory buffer.
Parameters:
input | The |
---|---|
buf | Pointer to the destination buffer where data should be copied. |
len | The maximum number of bytes to read into the buffer. |
Returns:
A strictly positive number of bytes read, 0 on end-of-stream, or -1 on unrecoverable error.