Version: 6.3.1
Public Member Functions | Private Member Functions | Private Attributes

MEDMEM_ENSIGHT._BinaryFileReader Class Reference

Reader of binary files. More...

#include <MEDMEM_EnsightUtils.hxx>

Public Member Functions

 _BinaryFileReader (const string &fileName) throw (MEDEXCEPTION)
 Constructor of _BinaryFileReader opens its file.
 ~_BinaryFileReader ()
 Destructor of _BinaryFileWriter closes its file.
void rewind ()
 rewind the file backward
void swapBytes ()
int moreValuesAvailable () const
 size of not read file portion in sizeof(int)
bool eof ()
 Return true if the whole file has been read.
void skip (int size) throw (MEDEXCEPTION)
 Skips given nb of bytes.
void skipTimeStepBeginning () throw (MEDEXCEPTION)
 Read lines until TIME_STEP_BEG encounters.
char * getLine () throw (MEDEXCEPTION)
intgetInt (int nb) throw (MEDEXCEPTION)
float * getFlt (int nb) throw (MEDEXCEPTION)
ssize_t getPosition () const
template<class T >
char * convertReals (const int nbValues, const char *undefValue=0, set< int > *undefIndices=0, const vector< int > *partialIndices=0, const int nbPartialComponents=0) throw (MEDEXCEPTION)

Private Member Functions

template<typename T >
T * get (int nb, bool inverseBytes=false)

Private Attributes

int _file
 descriptor
MEDEXCEPTION _exception
 ready to raise exception
ssize_t _pos
ssize_t _maxPos
 current position and end position
bool _mySwapBytes
 to swap bytes

Detailed Description

Reader of binary files.


Constructor & Destructor Documentation

MEDMEM_ENSIGHT._BinaryFileReader::_BinaryFileReader ( const string &  fileName) throw (MEDEXCEPTION)

Constructor of _BinaryFileReader opens its file.

References Med_Gen_test.fileName.

MEDMEM_ENSIGHT._BinaryFileReader::~_BinaryFileReader ( )

Destructor of _BinaryFileWriter closes its file.

References MEDMEM_ENSIGHT._BinaryFileReader._file.


Member Function Documentation

void MEDMEM_ENSIGHT._BinaryFileReader::rewind ( )
void MEDMEM_ENSIGHT._BinaryFileReader.swapBytes ( )
int MEDMEM_ENSIGHT._BinaryFileReader::moreValuesAvailable ( ) const

size of not read file portion in sizeof(int)

References MEDMEM_ENSIGHT._BinaryFileReader._maxPos, and MEDMEM_ENSIGHT._BinaryFileReader._pos.

bool MEDMEM_ENSIGHT._BinaryFileReader::eof ( )

Return true if the whole file has been read.

References MEDMEM_ENSIGHT._BinaryFileReader._maxPos, and MEDMEM_ENSIGHT._BinaryFileReader._pos.

void MEDMEM_ENSIGHT._BinaryFileReader::skip ( int  size) throw (MEDEXCEPTION)

Skips given nb of bytes.

References test_NonCoincidentDEC.size.

void MEDMEM_ENSIGHT._BinaryFileReader::skipTimeStepBeginning ( ) throw (MEDEXCEPTION)
char* MEDMEM_ENSIGHT._BinaryFileReader.getLine ( ) throw (MEDEXCEPTION)
int* MEDMEM_ENSIGHT._BinaryFileReader.getInt ( int  nb) throw (MEDEXCEPTION)
float* MEDMEM_ENSIGHT._BinaryFileReader.getFlt ( int  nb) throw (MEDEXCEPTION)
ssize_t MEDMEM_ENSIGHT._BinaryFileReader.getPosition ( ) const
template<class T >
char* MEDMEM_ENSIGHT._BinaryFileReader.convertReals ( const int  nbValues,
const char *  undefValue = 0,
set< int > *  undefIndices = 0,
const vector< int > *  partialIndices = 0,
const int  nbPartialComponents = 0 
) throw (MEDEXCEPTION)
template<typename T >
T* MEDMEM_ENSIGHT._BinaryFileReader.get ( int  nb,
bool  inverseBytes = false 
) [private]

References MEDMEM.swapBytes().


Field Documentation

descriptor

ready to raise exception

current position and end position

to swap bytes

read any data from file

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS