Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

lrt::DelphiDataInputStream Class Reference

Supports reading binary files in the Delphi format. More...

#include <rtdelphi.h>

Inheritance diagram for lrt::DelphiDataInputStream:

Inheritance graph
[legend]
List of all members.

Public Methods

 DelphiDataInputStream (InputStream *in)
 Creates a Delphi binary input stream which reads from another input stream. More...

 DelphiDataInputStream (const String &filename)
 Creates a Delphi binary input stream which reads from a file (given by its name). More...

virtual ~DelphiDataInputStream ()
Variant readAny ()
 Reads the next contained element from the file. More...

String readString ()
 Reads a String from the file. More...

int readInt ()
 Reads an integer from the file. More...

double readDouble ()
 Reads a floating-point number from the file. More...


Detailed Description

Supports reading binary files in the Delphi format.

The advantage of the Delphi binary file format is that it has prefixes which indicate the type of the next data structure in the file, so that even if you don't know what's in the file, you can still properly parse it.

Even though the original Delphi format is Intel-centric, with little-endian data format, this library should work on any platform.


Constructor & Destructor Documentation

lrt::DelphiDataInputStream::DelphiDataInputStream (  InputStream *    in ) 
 

Creates a Delphi binary input stream which reads from another input stream.

Note: When this input stream is deleted, the other one is deleted as well.

lrt::DelphiDataInputStream::DelphiDataInputStream (  const String &    filename ) 
 

Creates a Delphi binary input stream which reads from a file (given by its name).

This is a convenience constructor which ensures that the file is opened in binary mode.


Member Function Documentation

Variant lrt::DelphiDataInputStream::readAny (    ) 
 

Reads the next contained element from the file.

If the next data in the file is not a known element, exits the app.

double lrt::DelphiDataInputStream::readDouble (    ) 
 

Reads a floating-point number from the file.

Note: If the next data in the file is not a Delphi floating-point, exits the app.
Note: Supports 80-bit Delphi floating point numbers.

int lrt::DelphiDataInputStream::readInt (    ) 
 

Reads an integer from the file.

Note: If the next data in the file is not a Delphi integer, exits the app.
Note: Supports 8-bit, 16-bit and 32-bit integers.

String lrt::DelphiDataInputStream::readString (    ) 
 

Reads a String from the file.

Note: If the next data in the file is not a Delphi string, exits the app.
Note: Supports short (0x06) and long (0x0C) strings.


The documentation for this class was generated from the following files:
This is the RoboTour API documentation version 0.1 • Copyright (C) by Florian Fischer