1#ifndef DUNE_FEM_ASCIISTREAMS_HH
2#define DUNE_FEM_ASCIISTREAMS_HH
66 :
stream_( *(new
std :: ofstream( filename.c_str() )) ),
86 stream_.setf( std ::ios_base :: scientific, std :: ios_base :: floatfield );
88 stream_ << value << std :: endl;
96 stream_.setf( std ::ios_base :: scientific, std :: ios_base :: floatfield );
98 stream_ << value << std :: endl;
106 stream_ << value << std :: endl;
115 int val = (int) value;
122 std::string val( ( value ==
true ) ?
"true" :
"false" );
133 const unsigned int length = s.length();
135 for(
unsigned int i = 0; i < length; ++i )
215 :
stream_( *(new
std :: ifstream( filename.c_str() )) ),
266 else if ( val ==
"false" )
281 for(
unsigned int i = 0; i < length; ++i )
Definition: bindguard.hh:11
Definition: asciistreams.hh:19
ASCIIOutStream OutStreamType
Definition: asciistreams.hh:20
output stream writing into an STL output stream using ASCII encoding
Definition: asciistreams.hh:36
void writeUnsignedInt(unsigned int value)
write an unsigned int to the stream
Definition: asciistreams.hh:143
void flush()
flush the stream
Definition: asciistreams.hh:78
void writeString(const std::string &s)
write a string to the stream
Definition: asciistreams.hh:131
void writeChar(const char value)
write a char to the stream
Definition: asciistreams.hh:112
void writeInt(const int value)
write an int to the stream
Definition: asciistreams.hh:104
bool valid() const
Definition: asciistreams.hh:159
std::ostream & stream_
Definition: asciistreams.hh:45
ASCIIOutStream(std::ostream &stream)
constructor
Definition: asciistreams.hh:56
ASCIIOutStreamTraits Traits
type of the traits
Definition: asciistreams.hh:42
ASCIIOutStream(const std::string &filename)
constructor
Definition: asciistreams.hh:65
void writeDouble(const double value)
write a double to the stream
Definition: asciistreams.hh:84
bool mustFreeStream_
Definition: asciistreams.hh:46
void writeFloat(const float value)
write a float to the stream
Definition: asciistreams.hh:94
~ASCIIOutStream()
destructor
Definition: asciistreams.hh:71
void writeBool(const bool value)
write a char to the stream
Definition: asciistreams.hh:120
void writeUnsignedInt64(uint64_t value)
write an uint64_t to the stream
Definition: asciistreams.hh:151
Definition: asciistreams.hh:168
ASCIIInStream InStreamType
Definition: asciistreams.hh:169
input stream reading from an STL input stream using ASCII decoding
Definition: asciistreams.hh:185
void readBool(bool &value)
read a bool from the stream
Definition: asciistreams.hh:259
ASCIIInStreamTraits Traits
type of the traits
Definition: asciistreams.hh:191
void readChar(char &value)
read a char from the stream
Definition: asciistreams.hh:251
void readInt(int &value)
read an int from the stream
Definition: asciistreams.hh:243
void readUnsignedInt(unsigned int &value)
read an unsigned int from the stream
Definition: asciistreams.hh:288
ASCIIInStream(const std::string &filename)
constructor
Definition: asciistreams.hh:214
void readUnsignedInt64(uint64_t &value)
read an uint64_t from the stream
Definition: asciistreams.hh:296
void readDouble(double &value)
read a double from the stream
Definition: asciistreams.hh:227
std::istream & stream_
Definition: asciistreams.hh:194
bool valid() const
Definition: asciistreams.hh:304
bool mustFreeStream_
Definition: asciistreams.hh:195
void readString(std::string &s)
read a string from the stream
Definition: asciistreams.hh:277
ASCIIInStream(std::istream &stream)
constructor
Definition: asciistreams.hh:205
void readFloat(float &value)
read a float from the stream
Definition: asciistreams.hh:235
~ASCIIInStream()
destructor
Definition: asciistreams.hh:220
abstract interface for an output stream
Definition: streams.hh:46
void writeError() const
Definition: streams.hh:147
abstract interface for an input stream
Definition: streams.hh:179
void readError() const
Definition: streams.hh:348
int readInt()
read an int from the stream
Definition: streams.hh:250