TF++, Miscellaneous classes and modules in C++:

◆ end_block()

void tfxx::fortranio::FortranBinOutput::end_block ( )

finish data block

finally write the data (flush buffer)

Definition at line 155 of file fortranio.cc.

References tfxx::ioswap::IOUnion< T >::bytes, Mbuffer, Mostream, and tfxx::ioswap::IOUnion< T >::value.

Referenced by tfxx::fortranio::operator<<(), write_data(), tfxx::hacks::write_grepg_c(), write_magic(), and ~FortranBinOutput().

156  {
157  std::string buffer=Mbuffer.str();
159  count.value=buffer.size();
160  if (count.value>0)
161  {
162  Mostream.write(count.bytes, sizeof(int));
163  Mostream.write(buffer.c_str(), count.value);
164  Mostream.write(count.bytes, sizeof(int));
165  Mbuffer.str(std::string());
166  }
167  }
std::ostream & Mostream
The output stream to write to.
Definition: fortranio.h:222
char bytes[sizeof(T)]
Definition: bytesex.h:100
std::ostringstream Mbuffer
The buffering is done by a stringstream.
Definition: fortranio.h:224
Here is the caller graph for this function: