Main Page   Namespace List   Alphabetical List   Data Structures   File List   Data Fields   Globals  

ReadFile Class Reference

Reads modelisation files. More...


Static Public Methods

int parseVolumeNames (char name[], SCENE *scene)
int readModelisationFile (const char name[], SCENE *scene)
int addModelisationFile (const char name[], SCENE *scene)
void displayData (SCENE *scene, int detail)

Static Private Methods

int readInt (int nbchar, char *s, int line)
double readDouble (int nbchar, char *s, int line)
char * readString (int nbchar, char *s, int line)
char * substr (char *str, unsigned int start, unsigned int end)


Detailed Description

Reads modelisation files.

Reads a file in the "dat" format and extracts its information to the structure scene.


Member Function Documentation

int ReadFile::addModelisationFile const char    name[],
SCENE   scene
[static]
 

Adds an ASCII file describing the scene and returns an object of the type SCENE

Parameters:
name  : the file name
scene  : the structure returned
Returns:
EXIT_FAILURE for error and EXIT_SUCCESS if everything's ok

void ReadFile::displayData SCENE   scene,
int    detail
[static]
 

displays the data of the scene

Parameters:
scene  : a pointer to the scene
detail:  the desired level of detail (1: header only, 2:all)

int ReadFile::parseVolumeNames char    name[],
SCENE   scene
[static]
 

Reads only the super volumes names from the file

Parameters:
name  : the file name
scene  : the structure returned
Returns:
EXIT_FAILURE for error and EXIT_SUCCESS if everything's ok

double ReadFile::readDouble int    nbchar,
char *    s,
int    line
[static, private]
 

Parameters:
line  is used to debug errors in the file
nbchar  is the number of chars at the beginning of s to take
s  is the string containing the data

int ReadFile::readInt int    nbchar,
char *    s,
int    line
[static, private]
 

Parameters:
line  is used to debug errors in the file
nbchar  is the number of chars at the beginning of s to take
s  is the string containing the data

int ReadFile::readModelisationFile const char    name[],
SCENE   scene
[static]
 

Reads an ASCII file describing the scene and returns an object of the type SCENE

Parameters:
name  : the file name
scene  : the structure returned
Returns:
EXIT_FAILURE for error and EXIT_SUCCESS if everything's ok

char * ReadFile::readString int    nbchar,
char *    s,
int    line
[static, private]
 

Parameters:
line  is used to debug errors in the file
nbchar  is the number of chars at the beginning of s to take
s  is the string containing the data

char * ReadFile::substr char *    str,
unsigned int    start,
unsigned int    end
[static, private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 18 16:32:55 2004 for POVAMA by doxygen1.2.18