Murl Engine Lua Addon API  Version 1.0 beta
Murl.IFileInterface

The file access interface.

The file interface provides file access for locations on the target system specified by a IEnums::FileCategory.


Table members

Methods


FileExists(name, category)

Check if a file exists.

Boolean FileExists(String name, Murl.IEnums.FileCategory category)

Parameters
nameThe name of the file.
categoryThe category where the file reside.
Returns
Boolean true if the file exists.

FolderExists(name, category)

Check if a folder exists.

Boolean FolderExists(String name, Murl.IEnums.FileCategory category)

Parameters
nameThe name of the folder.
categoryThe category where the folder reside.
Returns
Boolean true if the folder exists.

GetAbsoluteName(relativeName, category, absoluteName)

Get the absolute file name.

Boolean, String GetAbsoluteName(String relativeName, Murl.IEnums.FileCategory category, String absoluteName)

Parameters
relativeNameThe name of the file.
categoryThe category where the file reside.
absoluteNameThe absolute file name return value.
Returns
Boolean true if successful, if false the 'absoluteName' return value is unchanged.
String absoluteName The absolute file name return value.

GetAllFileNames(relativePath, category, names)

Get all file names inside a folder.

Boolean, Murl.Array.String GetAllFileNames(String relativePath, Murl.IEnums.FileCategory category, Murl.Array.String names)

Parameters
relativePathThe name of the folder.
categoryThe category where the folder reside.
namesThe array of file names return value.
Returns
Boolean true if successful, if false the 'names' return value is unchanged.
Murl.Array.String names The array of file names return value.

GetAllFolderNames(relativePath, category, names)

Get all folder names inside a folder.

Boolean, Murl.Array.String GetAllFolderNames(String relativePath, Murl.IEnums.FileCategory category, Murl.Array.String names)

Parameters
relativePathThe name of the folder.
categoryThe category where the folder reside.
namesThe array of folder names return value.
Returns
Boolean true if successful, if false the 'names' return value is unchanged.
Murl.Array.String names The array of folder names return value.

OpenFile(name, category, mode, createFolders)

Open a file.

Murl.IFile OpenFile(String name, Murl.IEnums.FileCategory category, Murl.IEnums.FileAccessMode mode, Boolean createFolders)

Parameters
nameThe name of the file.
categoryThe category where the file reside.
modeThe access mode for the file to open.
createFoldersCreate the folders constained in file name if the folders do not exist.
Returns
Murl.IFile The file interface or null if not successful.

CloseFile(handle)

Close a file.

Boolean, Murl.IFile CloseFile(Murl.IFile handle)

Parameters
handleA reference to the file interface to close. After destruction the pointer is set to null.
Returns
Boolean true if successful.
Murl.IFile handle A reference to the file interface to close. After destruction the pointer is set to null.

MapFileData(name, category, data)

Memory-map a read-only file.

Boolean, Murl.ConstData MapFileData(String name, Murl.IEnums.FileCategory category, Murl.ConstData data)

Parameters
nameThe name of the file.
categoryThe category where the file reside.
dataThe file data object return value.
Returns
Boolean true if successful, if false the 'data' return value is unchanged.
Murl.ConstData data The file data object return value.

UnmapFileData(data)

Unmap a memory mapped file.

Boolean, Murl.ConstData UnmapFileData(Murl.ConstData data)

Parameters
dataThe file data object to the memory mapped file. After unmapping the data object is empty.
Returns
Boolean true if successful.
Murl.ConstData data The file data object to the memory mapped file. After unmapping the data object is empty.