Fortran SFF API to data I/O streams in C++

◆ encodebinary()

void fapidxx::WID2container::encodebinary ( char *  fstring,
ftnlen  slen 
) const

encode data into a binary character string

binary encode WID2 data in character sequence

This function is prepared to encode WID2 data in binary form in a character sequence.

Parameters
fstringWID2 line character sequence produced from WID2 data in member data WID2container::wid2; this is the return value of the function (output value)
slenlength of character array fstring

Definition at line 144 of file wid2container.cc.

References FAPIDXX_assert, fapidxx::WID2container::WID2struct::set(), and wid2.

Referenced by encode().

145  {
146  WID2container::WID2struct ws;
147  ws.set(this->wid2);
148  int w2size=sizeof(WID2container::WID2struct);
149  FAPIDXX_assert(w2size<=slen,
150  "WID2container::encode: struct is too large");
151  std::memcpy(fstring, &ws, w2size);
152  } // void WID2container::encodebinary(char *fstring, ftnlen slen)
sff::WID2 wid2
WID2 data.
#define FAPIDXX_assert(C, M)
Check an assertion and report by throwing an exception.
Definition: error.h:157
Here is the call graph for this function:
Here is the caller graph for this function: