Drag[en]gine Script Module DragonScript Script API  1.0
FileReader Class Reference

File reader. More...

Inheritance diagram for FileReader:

Public Member Functions

Constructors
FileReader new (String filename)
 Create file reader. More...
 
Management
String getFilename ()
 File name. More...
 
int getLength ()
 File size in bytes. More...
 
int getPosition ()
 Current reading position in bytes from the beginning of the file. More...
 
void setPosition (int position)
 Set reading file position in bytes relative to beginning of file. More...
 
void movePosition (int offset)
 Move reading file position by offset in bytes. More...
 
void setPositionEnd (int position)
 Set reading file position in bytes relative to end of file. More...
 
int getStreamVersion ()
 Stream version used by readFromFile of native classes. More...
 
void setStreamVersion (int version)
 Set stream version used by readFromFile of native classes. More...
 
bool eof ()
 File reading pointer is at the end of file. More...
 
String read (int size)
 Read bytes and advance the file reading position. More...
 
int readChar ()
 Read one byte ( 1 byte ) and advance the file reading position. More...
 
int readByte ()
 Read one unsigned byte ( 1 byte ) and advance the file reading position. More...
 
int readShort ()
 Read one short ( 2 bytes ) and advance the file reading position. More...
 
int readUShort ()
 Read one unsigned short ( 2 bytes ) and advance the file reading position. More...
 
int readInt ()
 Read one int ( 4 bytes ) and advance the file reading position. More...
 
int readUInt ()
 Read one unsigned int ( 4 bytes ) and advance the file reading position. More...
 
float readFloat ()
 Read one float ( 4 bytes ) and advance the file reading position. More...
 
String readString8 ()
 Read a string prefixed by a 1-byte length field and advance the file reading position. More...
 
String readString16 ()
 Read a string prefixed by a 2-byte2 length field and advance the file reading position. More...
 
void skipString8 ()
 Skips a string prefixed by a 1-byte length field and advance the file reading position. More...
 
void skipString16 ()
 Skips a string prefixed by a 2-byte2 length field and advance the file reading position. More...
 

Detailed Description

File reader.

This is a native class.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

Member Function Documentation

§ eof()

bool eof ( )

File reading pointer is at the end of file.

§ getFilename()

String getFilename ( )

File name.

§ getLength()

int getLength ( )

File size in bytes.

§ getPosition()

int getPosition ( )

Current reading position in bytes from the beginning of the file.

§ getStreamVersion()

int getStreamVersion ( )

Stream version used by readFromFile of native classes.

§ movePosition()

void movePosition ( int  offset)

Move reading file position by offset in bytes.

§ new()

FileReader new ( String  filename)

Create file reader.

§ read()

String read ( int  size)

Read bytes and advance the file reading position.

§ readByte()

int readByte ( )

Read one unsigned byte ( 1 byte ) and advance the file reading position.

§ readChar()

int readChar ( )

Read one byte ( 1 byte ) and advance the file reading position.

§ readFloat()

float readFloat ( )

Read one float ( 4 bytes ) and advance the file reading position.

§ readInt()

int readInt ( )

Read one int ( 4 bytes ) and advance the file reading position.

§ readShort()

int readShort ( )

Read one short ( 2 bytes ) and advance the file reading position.

§ readString16()

String readString16 ( )

Read a string prefixed by a 2-byte2 length field and advance the file reading position.

§ readString8()

String readString8 ( )

Read a string prefixed by a 1-byte length field and advance the file reading position.

§ readUInt()

int readUInt ( )

Read one unsigned int ( 4 bytes ) and advance the file reading position.

§ readUShort()

int readUShort ( )

Read one unsigned short ( 2 bytes ) and advance the file reading position.

§ setPosition()

void setPosition ( int  position)

Set reading file position in bytes relative to beginning of file.

§ setPositionEnd()

void setPositionEnd ( int  position)

Set reading file position in bytes relative to end of file.

§ setStreamVersion()

void setStreamVersion ( int  version)

Set stream version used by readFromFile of native classes.

§ skipString16()

void skipString16 ( )

Skips a string prefixed by a 2-byte2 length field and advance the file reading position.

§ skipString8()

void skipString8 ( )

Skips a string prefixed by a 1-byte length field and advance the file reading position.


The documentation for this class was generated from the following file: