File

class File()

CreateFile()

Close()
GetLength()
GetPointer()
File.ReadData(length, mode)
  • mode - “Hex”, “Int”, “Text”
file.ReadText(2)
File.ReadNumber(type)
  • types - “Byte”, “UByte”, “Bool”, “Float”, “FloatLE”, “Long”, “LongLE”, “Short”, “UShort”, “ShortLE”, “UShortLE”, “Int”, “UInt”, “IntLE”, “UIntLE”
File.ReadText(type)
  • types -
    • UTF - reads a UTF-8 string with 2 byte header.
    • Line - reads a whole text line terminated by ‘n’, ‘r’, “rn”
    • Char - reads a big-endian 16-bit character
file.ReadText( "Line" )
Seek(offset)
SetLength(length)
Skip()
WriteData(data, mode)
  • mode
    • Hex - “FA,FB,FC”
    • Int - “250,251,252”
    • Text - “abc46” => Writes the low order 8-bit bytes.
file.WriteData( "66,121,101", "Int" );
File.WriteNumber(data, type)
  • type - “Byte”, “UByte”, “Bool”, “Float”, “FloatLE”, “Long”, “LongLE”, “Short”, “UShort”, “ShortLE”, “UShortLE”, “Int”, “UInt”, “IntLE”, “UIntLE”
file.WriteNumber( 77, "Byte" );
WriteText(data, type)
  • type -
    • Bytes - Writes the low order 8-bit bytes.
    • Chars - Writes big-endian 16-bit characters.
    • UTF - Writes text encoded with UTF-8.
file.WriteText( "Hello", "Chars" );