OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::FileDataStream Class Reference

Implementation of FileDataStream representing DataStream interface to file i/o. More...

#include <datastream.h>

+ Inheritance diagram for oofem::FileDataStream:
+ Collaboration diagram for oofem::FileDataStream:

Classes

class  CantOpen
 

Public Member Functions

 FileDataStream (std::string filename, bool write)
 Constructor, takes associated stream pointer as parameter. More...
 
virtual ~FileDataStream ()
 Destructor (will not close stream!) More...
 
virtual int read (int *data, int count)
 Reads count integer values into array pointed by data. More...
 
virtual int read (unsigned long *data, int count)
 Reads count unsigned long values into array pointed by data. More...
 
virtual int read (long *data, int count)
 Reads count long values into array pointed by data. More...
 
virtual int read (double *data, int count)
 Reads count double values into array pointed by data. More...
 
virtual int read (char *data, int count)
 Reads count char values into array pointed by data. More...
 
virtual int read (bool &data)
 Reads a bool value from data. More...
 
virtual int write (const int *data, int count)
 Writes count integer values from array pointed by data. More...
 
virtual int write (const unsigned long *data, int count)
 Writes count unsigned long values from array pointed by data. More...
 
virtual int write (const long *data, int count)
 Writes count long values from array pointed by data. More...
 
virtual int write (const double *data, int count)
 Writes count double values from array pointed by data. More...
 
virtual int write (const char *data, int count)
 Writes count char values from array pointed by data. More...
 
virtual int write (bool data)
 Writes a bool value. More...
 
virtual int givePackSizeOfInt (int count)
 
virtual int givePackSizeOfDouble (int count)
 
virtual int givePackSizeOfChar (int count)
 
virtual int givePackSizeOfBool (int count)
 
virtual int givePackSizeOfLong (int count)
 
- Public Member Functions inherited from oofem::DataStream
virtual ~DataStream ()
 Destructor. More...
 
int read (int &data)
 
int read (unsigned long &data)
 
int read (long &data)
 
int read (double &data)
 
int read (char &data)
 
int read (std::string &data)
 Reads a string (stored as an int for the length followed by char*). More...
 
int write (int data)
 
int write (unsigned long data)
 
int write (long data)
 
int write (double data)
 
int write (char data)
 
int write (const std::string &data)
 Reads a string (stored as an int for the length followed by char*). More...
 
int write (const char *data)
 Writes a string (wrapper needed, otherwise write(bool) is called ) More...
 

Private Attributes

FILE * stream
 FILE pointer of associated stream. More...
 
std::string filename
 Filename. More...
 

Detailed Description

Implementation of FileDataStream representing DataStream interface to file i/o.

This class creates a DataStream shell around c file i/o routines. This class will not provide any methods for opening/closing file. This is the responsibility of user.

See also
DataStream class.

Definition at line 136 of file datastream.h.

Constructor & Destructor Documentation

oofem::FileDataStream::FileDataStream ( std::string  filename,
bool  write 
)

Constructor, takes associated stream pointer as parameter.

Definition at line 65 of file datastream.C.

References stream.

oofem::FileDataStream::~FileDataStream ( )
virtual

Destructor (will not close stream!)

Definition at line 76 of file datastream.C.

References stream.

Member Function Documentation

int oofem::FileDataStream::givePackSizeOfBool ( int  count)
virtual

Implements oofem::DataStream.

Definition at line 158 of file datastream.C.

int oofem::FileDataStream::givePackSizeOfChar ( int  count)
virtual

Implements oofem::DataStream.

Definition at line 153 of file datastream.C.

int oofem::FileDataStream::givePackSizeOfDouble ( int  count)
virtual

Implements oofem::DataStream.

Definition at line 148 of file datastream.C.

int oofem::FileDataStream::givePackSizeOfInt ( int  count)
virtual

Implements oofem::DataStream.

Definition at line 143 of file datastream.C.

int oofem::FileDataStream::givePackSizeOfLong ( int  count)
virtual

Implements oofem::DataStream.

Definition at line 163 of file datastream.C.

int oofem::FileDataStream::read ( int *  data,
int  count 
)
virtual

Reads count integer values into array pointed by data.

Implements oofem::DataStream.

Definition at line 81 of file datastream.C.

References stream.

int oofem::FileDataStream::read ( unsigned long *  data,
int  count 
)
virtual

Reads count unsigned long values into array pointed by data.

Implements oofem::DataStream.

Definition at line 88 of file datastream.C.

References stream.

int oofem::FileDataStream::read ( long *  data,
int  count 
)
virtual

Reads count long values into array pointed by data.

Implements oofem::DataStream.

Definition at line 93 of file datastream.C.

References stream.

int oofem::FileDataStream::read ( double *  data,
int  count 
)
virtual

Reads count double values into array pointed by data.

Implements oofem::DataStream.

Definition at line 98 of file datastream.C.

References stream.

int oofem::FileDataStream::read ( char *  data,
int  count 
)
virtual

Reads count char values into array pointed by data.

Implements oofem::DataStream.

Definition at line 103 of file datastream.C.

References stream.

int oofem::FileDataStream::read ( bool &  data)
virtual

Reads a bool value from data.

Implements oofem::DataStream.

Definition at line 108 of file datastream.C.

References stream.

int oofem::FileDataStream::write ( const int *  data,
int  count 
)
virtual

Writes count integer values from array pointed by data.

Implements oofem::DataStream.

Definition at line 113 of file datastream.C.

References stream.

int oofem::FileDataStream::write ( const unsigned long *  data,
int  count 
)
virtual

Writes count unsigned long values from array pointed by data.

Implements oofem::DataStream.

Definition at line 118 of file datastream.C.

References stream.

int oofem::FileDataStream::write ( const long *  data,
int  count 
)
virtual

Writes count long values from array pointed by data.

Implements oofem::DataStream.

Definition at line 123 of file datastream.C.

References stream.

int oofem::FileDataStream::write ( const double *  data,
int  count 
)
virtual

Writes count double values from array pointed by data.

Implements oofem::DataStream.

Definition at line 128 of file datastream.C.

References stream.

int oofem::FileDataStream::write ( const char *  data,
int  count 
)
virtual

Writes count char values from array pointed by data.

Implements oofem::DataStream.

Definition at line 133 of file datastream.C.

References stream.

int oofem::FileDataStream::write ( bool  data)
virtual

Writes a bool value.

Implements oofem::DataStream.

Definition at line 138 of file datastream.C.

References stream.

Member Data Documentation

std :: string oofem::FileDataStream::filename
private

Filename.

Definition at line 150 of file datastream.h.

FILE* oofem::FileDataStream::stream
private

FILE pointer of associated stream.

Definition at line 148 of file datastream.h.

Referenced by FileDataStream(), read(), write(), and ~FileDataStream().


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

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:35 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011