DATRW++ library: seismic data I/O with multiple formats

◆ write()

void datrw::su::SUheader::write ( std::ostream &  os) const

write struct to file

Definition at line 96 of file suheader.cc.

References DATRW_assert, DATRW_debug, Mdebug, and Mheader.

Referenced by datrw::osustream::writetrace().

97  {
98  const char *ipointer=reinterpret_cast<const char *>(&Mheader);
99  DATRW_assert(os.write(ipointer, sizeof(TraceHeaderStruct)),
100  "ERROR (SUheader::write): writing SU header");
101  DATRW_debug(Mdebug, "SUheader::write(std::ostream& os)",
102  "wrote "
103  << sizeof(TraceHeaderStruct) << " bytes; "
104  << "os.good() returns " << os.good());
105  } // void write(std::ostream& os) const
#define DATRW_assert(C, M)
Check an assertion and report by throwing an exception.
Definition: error.h:92
bool Mdebug
be verbose
Definition: suheader.h:204
#define DATRW_debug(C, N, M)
produce debug output
Definition: debug.h:50
TraceHeaderStruct Mheader
the actual data fields are provided for public access
Definition: suheader.h:239
Here is the caller graph for this function: