66 virtual int read(
int *data,
int count) = 0;
68 int read(
int &data) {
return this->
read(&data, 1); }
70 virtual int read(
unsigned long *data,
int count) = 0;
71 int read(
unsigned long &data) {
return this->
read(&data, 1); }
73 virtual int read(
long *data,
int count) = 0;
74 int read(
long &data) {
return this->
read(&data, 1); }
76 virtual int read(
double *data,
int count) = 0;
77 int read(
double &data) {
return this->
read(&data, 1); }
79 virtual int read(
char *data,
int count) = 0;
80 int read(
char &data) {
return this->
read(&data, 1); }
82 virtual int read(
bool &data) = 0;
84 int read(std :: string &data);
93 virtual int write(
const int *data,
int count) = 0;
97 virtual int write(
const unsigned long *data,
int count) = 0;
98 int write(
unsigned long data) {
return this->
write(&data, 1); }
100 virtual int write(
const long *data,
int count) = 0;
103 virtual int write(
const double *data,
int count) = 0;
106 virtual int write(
const char *data,
int count) = 0;
109 virtual int write(
bool data) = 0;
111 int write(
const std :: string &data);
113 int write(
const char *data) {
return this->
write(std :: string(data)); }
121 virtual int givePackSizeOfInt(
int count) = 0;
122 virtual int givePackSizeOfDouble(
int count) = 0;
123 virtual int givePackSizeOfChar(
int count) = 0;
124 virtual int givePackSizeOfBool(
int count) = 0;
125 virtual int givePackSizeOfLong(
int count) = 0;
143 CantOpen(std::string file):
std::runtime_error(
"can't open file"), filename(
std::move(file)) {}
158 virtual int read(
int *data,
int count);
159 virtual int read(
unsigned long *data,
int count);
160 virtual int read(
long *data,
int count);
161 virtual int read(
double *data,
int count);
162 virtual int read(
char *data,
int count);
163 virtual int read(
bool &data);
165 virtual int write(
const int *data,
int count);
166 virtual int write(
const unsigned long *data,
int count);
167 virtual int write(
const long *data,
int count);
168 virtual int write(
const double *data,
int count);
169 virtual int write(
const char *data,
int count);
170 virtual int write(
bool data);
172 virtual int givePackSizeOfInt(
int count);
173 virtual int givePackSizeOfDouble(
int count);
174 virtual int givePackSizeOfChar(
int count);
175 virtual int givePackSizeOfBool(
int count);
176 virtual int givePackSizeOfLong(
int count);
180 #endif // datastream_h Implementation of FileDataStream representing DataStream interface to file i/o.
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
std::string filename
Filename.
int read(unsigned long &data)
CantOpen(std::string file)
int write(const char *data)
Writes a string (wrapper needed, otherwise write(bool) is called )
int write(unsigned long data)
virtual ~DataStream()
Destructor.
the oofem namespace is to define a context or scope in which all oofem names are defined.
FILE * stream
FILE pointer of associated stream.