Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Teddy::SpaceGame::FrontierFile Class Reference

Parses Frontier: First Encounters ships from disassembled source files. More...

#include <FrontierFile.h>

List of all members.

Public Methods

 FrontierFile (const char *fname, Uint32 options)
 FrontierFile constructor. More...

void seek (const char *label_index)
 Seek to spesified label position. More...

void seek (const Sint32 bytes)
 Seek to spesified byte offset file position. More...

void reset ()
 Seek to previously set file start. More...

void skip_white ()
 Seek to next non-white character. More...

int get_type ()
 Determine type of next element. More...

Uint8 get_byte ()
 Interprete byte from file, encoded either into string or hex code. More...

Uint8 get_byte_low (bool gt=true)
 Get first character of byte. More...

char * get_label_def ()
 Read label definition. More...

char * get_label_ref ()
 Read reference to a label. More...

char * get_string ()
 Read string which ends at ' or : or , or. More...

Sint8 read_Sint8 ()
 Read signed 8-bit integer. More...

Sint16 read_Sint16 ()
 Read signed 16-bit integer. More...

Sint32 read_Sint32 ()
 Read signed 32-bit integer. More...

Uint8 read_Uint8 ()
 Read unsigned 8-bit integer. More...

Uint16 read_Uint16 ()
 Read unsigned 16-bit integer. More...

Uint32 read_Uint32 ()
 Read unsigned 32-bit integer. More...

float read_float ()
 Read 32-bit floating point number. More...

char * read_string ()

Protected Attributes

char * buf
 Buffer. More...

char * pos
 Current pointer. More...


Detailed Description

Parses Frontier: First Encounters ships from disassembled source files.

Definition at line 44 of file FrontierFile.h.


Constructor & Destructor Documentation

Teddy::SpaceGame::FrontierFile::FrontierFile const char *    fname,
Uint32    options
 

FrontierFile constructor.

Definition at line 40 of file FrontierFile.cpp.

References buf, and pos.


Member Function Documentation

Uint8 Teddy::SpaceGame::FrontierFile::get_byte  
 

Interprete byte from file, encoded either into string or hex code.

Definition at line 155 of file FrontierFile.cpp.

References FF_BYTE, FF_STRING, get_byte_low(), get_string(), get_type(), and pos.

Referenced by get_label_ref(), read_float(), read_Sint16(), read_Sint32(), read_Sint8(), read_Uint16(), read_Uint32(), and read_Uint8().

Uint8 Teddy::SpaceGame::FrontierFile::get_byte_low bool    gt = true
 

Get first character of byte.

Definition at line 208 of file FrontierFile.cpp.

References FF_BYTE, FF_LABEL_DEF, FF_LABEL_REF, FF_STRING, FF_UNKNOWN, get_type(), and pos.

Referenced by get_byte(), and get_label_ref().

char * Teddy::SpaceGame::FrontierFile::get_label_def  
 

Read label definition.

Definition at line 392 of file FrontierFile.cpp.

References FF_BYTE, FF_LABEL_DEF, FF_LABEL_REF, FF_STRING, FF_UNKNOWN, get_type(), and pos.

char * Teddy::SpaceGame::FrontierFile::get_label_ref  
 

Read reference to a label.

Definition at line 434 of file FrontierFile.cpp.

References FF_BYTE, FF_LABEL_DEF, FF_LABEL_REF, FF_STRING, FF_UNKNOWN, get_byte(), get_byte_low(), get_type(), and pos.

char * Teddy::SpaceGame::FrontierFile::get_string  
 

Read string which ends at ' or : or , or.

Definition at line 350 of file FrontierFile.cpp.

References FF_BYTE, FF_LABEL_DEF, FF_LABEL_REF, FF_STRING, FF_UNKNOWN, get_type(), and pos.

Referenced by get_byte().

int Teddy::SpaceGame::FrontierFile::get_type  
 

Determine type of next element.

Definition at line 86 of file FrontierFile.cpp.

References FF_BYTE, FF_LABEL_DEF, FF_LABEL_REF, FF_STRING, pos, and skip_white().

Referenced by get_byte(), get_byte_low(), get_label_def(), get_label_ref(), and get_string().

float Teddy::SpaceGame::FrontierFile::read_float  
 

Read 32-bit floating point number.

Definition at line 342 of file FrontierFile.cpp.

References get_byte().

Sint16 Teddy::SpaceGame::FrontierFile::read_Sint16  
 

Read signed 16-bit integer.

Definition at line 295 of file FrontierFile.cpp.

References get_byte().

Sint32 Teddy::SpaceGame::FrontierFile::read_Sint32  
 

Read signed 32-bit integer.

Definition at line 304 of file FrontierFile.cpp.

References get_byte().

Sint8 Teddy::SpaceGame::FrontierFile::read_Sint8  
 

Read signed 8-bit integer.

Definition at line 288 of file FrontierFile.cpp.

References get_byte().

char* Teddy::SpaceGame::FrontierFile::read_string  
 

Uint16 Teddy::SpaceGame::FrontierFile::read_Uint16  
 

Read unsigned 16-bit integer.

Definition at line 322 of file FrontierFile.cpp.

References get_byte().

Uint32 Teddy::SpaceGame::FrontierFile::read_Uint32  
 

Read unsigned 32-bit integer.

Definition at line 331 of file FrontierFile.cpp.

References get_byte().

Uint8 Teddy::SpaceGame::FrontierFile::read_Uint8  
 

Read unsigned 8-bit integer.

Definition at line 315 of file FrontierFile.cpp.

References get_byte().

void Teddy::SpaceGame::FrontierFile::reset  
 

Seek to previously set file start.

Definition at line 72 of file FrontierFile.cpp.

References buf, and pos.

void Teddy::SpaceGame::FrontierFile::seek const Sint32    bytes
 

Seek to spesified byte offset file position.

Definition at line 66 of file FrontierFile.cpp.

References pos.

void Teddy::SpaceGame::FrontierFile::seek const char *    label
 

Seek to spesified label position.

Definition at line 57 of file FrontierFile.cpp.

References pos.

void Teddy::SpaceGame::FrontierFile::skip_white  
 

Seek to next non-white character.

Definition at line 78 of file FrontierFile.cpp.

References pos.

Referenced by get_type().


Member Data Documentation

char* Teddy::SpaceGame::FrontierFile::buf [protected]
 

Buffer.

Definition at line 68 of file FrontierFile.h.

Referenced by FrontierFile(), and reset().

char* Teddy::SpaceGame::FrontierFile::pos [protected]
 

Current pointer.

Definition at line 69 of file FrontierFile.h.

Referenced by FrontierFile(), get_byte(), get_byte_low(), get_label_def(), get_label_ref(), get_string(), get_type(), reset(), seek(), and skip_white().


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