Murl Engine Lua Addon API  Version 1.0 beta
Murl.Util.File

Utility class implementing the IFile interface.


Table members

Inherited


Murl.IFile

Functions


Murl.Util.File.new(name, accessMode)

Constructor taking the file name and access mode.

Murl.Util.File new(String name, Murl.IEnums.FileAccessMode accessMode)

Parameters
nameThe file name.
accessModeThe access mode for opening the file.
Returns
Murl.Util.File


Methods


GetPosition()

Implementation of IFile::GetPosition().

Integer GetPosition()

Returns
Integer The position of the file pointer in bytes.

SetPosition(position)

Implementation of IFile::SetPosition().

SetPosition(Integer position)

Parameters
positionThe position of the file pointer in bytes.

GetSize()

Implementation of IFile::GetSize().

Integer GetSize()

Returns
Integer The size of the file in bytes.

Read(data)

Implementation of IFile::Read(Data& data).

Integer, Murl.Data Read(Murl.Data data)

Parameters
dataThe data object to read the file into.
Returns
Integer The number of bytes read into the data object.
Murl.Data data The data object to read the file into.

Write(data)

Implementation of IFile::Write(const ConstData& data).

Integer Write(Murl.ConstData data)

Parameters
dataThe data object to write into the file.
Returns
Integer The number of bytes written into the file.

Open()

Open the file. Open with the name and access mode specified by the constructor.

Boolean Open()

Returns
Boolean true if successful.

Close()

Close the file.

Boolean Close()

Returns
Boolean true if successful.